Commit 7a1d34fb94319d18a1078e7e4a9ca6dc3fe5cd17
1 parent
ab002d71
Exists in
community_hub_submodule
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,7 +4,7 @@ require 'json' | ||
4 | 4 | ||
5 | token = 'CAAD8cd4tMVkBAO3sh2DrzwZCDfeQq9ZAvTz7Jz24ZC26KtMfBoljqaXhD2vBV1zpP0bjrpxXUBzJvKKcFzOm6rMG9Sok7iNVUaxt5iwr7dfMqCvHpMboKpqrqgeLrfCH5ITVTAdezA6ZBSr9iOJrqyCSOYfui0zTmbXJ3FqtshwNRrRy4NPH' | 5 | token = 'CAAD8cd4tMVkBAO3sh2DrzwZCDfeQq9ZAvTz7Jz24ZC26KtMfBoljqaXhD2vBV1zpP0bjrpxXUBzJvKKcFzOm6rMG9Sok7iNVUaxt5iwr7dfMqCvHpMboKpqrqgeLrfCH5ITVTAdezA6ZBSr9iOJrqyCSOYfui0zTmbXJ3FqtshwNRrRy4NPH' |
6 | hashtag = "#nba" | 6 | hashtag = "#nba" |
7 | -pooling_time = 5 | 7 | +pooling_time = 10 |
8 | 8 | ||
9 | 9 | ||
10 | #Aviso 12/04/2014 | 10 | #Aviso 12/04/2014 |
@@ -24,13 +24,13 @@ if hashtag[0]='#' | @@ -24,13 +24,13 @@ if hashtag[0]='#' | ||
24 | hashtag = hashtag[1,hashtag.length-1] | 24 | hashtag = hashtag[1,hashtag.length-1] |
25 | end | 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 | extractedComments = [] | 27 | extractedComments = [] |
31 | initialComments = [] | 28 | initialComments = [] |
32 | firstTime = true | 29 | firstTime = true |
30 | + | ||
33 | while true | 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 | mostRecent = "" | 34 | mostRecent = "" |
35 | itens.each{|i| | 35 | itens.each{|i| |
36 | from = "" | 36 | from = "" |