Note that there are some explanatory texts on larger screens.

plurals
  1. POJson Twitter Search - How to
    primarykey
    data
    text
    <p>I'm trying to create strings from the <code>u'text':</code> &amp; <code>u'id':</code> found in <code>u'results':</code> So that I can compare new IDs to the last one read and display the text if it is new. I cannot currently parse(?) only the information I want. </p> <pre><code>import json import urllib from pprint import pprint j =json.loads(urllib.urlopen('http://search.twitter.com/search.json?q=%23tory&amp;result_type=recent&amp;rpp=1').read()) pprint(j) </code></pre> <p>This gives me </p> <blockquote> <p></p> </blockquote> <pre><code>{u'completed_in': 0.007, u'max_id': 312184292639920129L, u'max_id_str': u'312184292639920129', u'next_page': u'?page=2&amp;max_id=312184292639920129&amp;q=%23tory&amp;rpp=1&amp;result_type=recent', u'page': 1, u'query': u'%23tory', u'refresh_url': u'?since_id=312184292639920129&amp;q=%23tory&amp;result_type=recent', u'results': [{u'created_at': u'Thu, 14 Mar 2013 12:51:50 +0000', u'from_user': u'DerbysLabour', u'from_user_id': 393219652, u'from_user_id_str': u'393219652', u'from_user_name': u'Derbyshire Labour', u'geo': None, u'id': 312184292639920129L, u'id_str': u'312184292639920129', u'iso_language_code': u'en', u'metadata': {u'result_type': u'recent'}, u'profile_image_url': u'http://a0.twimg.com/profile_images/1594091282/Labour_group_normal.jpg', u'profile_image_url_https': u'https://si0.twimg.com/profile_images/1594091282/Labour_group_normal.jpg', u'source': u'&amp;lt;a href=&amp;quot;http://twitter.com/&amp;quot;&amp;gt;web&amp;lt;/a&amp;gt;', u'text': u'RT @WubeyOneKenobi: Not seen a single #Tory campaigning for #DCC elections round #Glossop yet. Scared to come out?'}], u'results_per_page': 1, u'since_id': 0, u'since_id_str': u'0'} </code></pre> <p>in return (depending on the tweet)</p> <p>How do we read the Text &amp; ID from the Results only? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload