No Twitter generator in search???

1 view
Skip to first unread message

Phil

unread,
May 24, 2010, 12:22:38 PM5/24/10
to contextvoice-dev
Hello,

I am trying to filter by Twitter responses, however I never find
generator = twitter. I have tried multiple search terms, but no luck.
Is twitter not supported at the moment?


My code is:

import urllib
import simplejson as json

api_key = "key"
# Get search results, json response:
query = 'london'

search_data = 'http://api.contextvoice.com/1.2/resources/search/?q=
%s&apikey=%s&format=json&count=100' % (query, api_key)
r = urllib.urlopen(search_data).read()

r = json.loads(str(r))

results = r["results"]
for n in results:
if n["generator"] == "twitter":
print n

Cheers,
Phil

--
You received this message because you are subscribed to the Google Groups "contextvoice-dev" group.
To post to this group, send email to contextv...@googlegroups.com.
To unsubscribe from this group, send email to contextvoice-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/contextvoice-dev?hl=en.

Dan

unread,
May 24, 2010, 2:32:15 PM5/24/10
to contextvoice-dev
Hi Phil,

We group conversations using their URL as a key to group all
reactions.

So what you need to do is the following:

for each conversation in search results

do a get call to the /1.2/reactions/?url=conversation_url

and filter all those reaction by generator (twitter in your case).

Let me know if this is clear enough.

Best regards,
Dan

Phil

unread,
May 28, 2010, 8:21:58 AM5/28/10
to contextvoice-dev
Hi Dan,

Thanks for your reply. OK I tried that and it works. Not very
intuitive at first.

Cheers,
Phil
Reply all
Reply to author
Forward
0 new messages