Commit 7a1d34fb94319d18a1078e7e4a9ca6dc3fe5cd17

Authored by Evandro Junior
1 parent ab002d71
Exists in master

read file fix

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
facebook_stream/codfish_facebook_api.rb
... ... @@ -4,7 +4,7 @@ require 'json'
4 4  
5 5 token = 'CAAD8cd4tMVkBAO3sh2DrzwZCDfeQq9ZAvTz7Jz24ZC26KtMfBoljqaXhD2vBV1zpP0bjrpxXUBzJvKKcFzOm6rMG9Sok7iNVUaxt5iwr7dfMqCvHpMboKpqrqgeLrfCH5ITVTAdezA6ZBSr9iOJrqyCSOYfui0zTmbXJ3FqtshwNRrRy4NPH'
6 6 hashtag = "#nba"
7   -pooling_time = 5
  7 +pooling_time = 10
8 8  
9 9  
10 10 #Aviso 12/04/2014
... ... @@ -24,13 +24,13 @@ if hashtag[0]='#'
24 24 hashtag = hashtag[1,hashtag.length-1]
25 25 end
26 26  
27   -file = open("https://graph.facebook.com/v1.0/search?q=%23#{hashtag}&type=post&access_token=#{token}")
28   -itens = JSON.parse(file.read)['data']
29   -
30 27 extractedComments = []
31 28 initialComments = []
32 29 firstTime = true
  30 +
33 31 while true
  32 + file = open("https://graph.facebook.com/v1.0/search?q=%23#{hashtag}&type=post&access_token=#{token}")
  33 + itens = JSON.parse(file.read)['data']
34 34 mostRecent = ""
35 35 itens.each{|i|
36 36 from = ""
... ...