Wednesday, January 25, 2012

Twitter RSS Feed Cheat Sheet (Redux)

Some notes on constructing searches that I've learned the hard way, but you don't have to:
  • Find a handy url-encoding cheat-sheet, like this one: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm. You will have to replace special characters  (@, #, :, etc.) with their url-encoded version.

  • + and %20 (a url-encoded space) seem to be interchangeable when constructing complex search queries. If one doesn't work in between each search parameter, try the other. (Replace the "+" with OR for searches that return any of the keywords/search parameters, as opposed to all the keywords/search parameters.)

  • To see how Twitter itself is constructing a query, do the search in their advanced search (https://twitter.com/#!/search-advanced), then follow this formula to construct your feed:

    Take the url that is produced from your search and replace the first part (https://twitter.com/#!/search/) with the rss version (http://search.twitter.com/search.atom?q=).

    You will go from this: https://twitter.com/#!/search/librarian%20tattoo
    to this:
    http://search.twitter.com/search.atom?q= librarian%20tattoo

  • You can probably replace the ".atom" with ".rss" if you prefer. (As pointed out by @calimae.)

************************


Here are some pre-constructed feeds, where you just replace the bold info with the info you want to use:

Hashtag search: http://search.twitter.com/search.atom?q=%23library

User mention search: http://search.twitter.com/search.atom?q=%40val_forrestal

Specific user's entire timeline: http://search.twitter.com/search.atom?q=from%3Aval_forrestal

Keyword search: http://search.twitter.com/search.atom?q=research+paper

Location + keyword search: http://search.twitter.com/search.atom?geocode=40.744544%2C-74.027593%2C5.0mi&q=+research+paper+near%3A%22hoboken%2C+nj%22+within%3A5mi

User mention + hashtag: http://search.twitter.com/search.atom?q=%40val_forrestal+%23library

User + hashtag: http://search.twitter.com/search.atom?q=from%3Aval_forrestal+%23library

Hashtag + date: http://search.twitter.com/search.atom?q=%23library%20since%3A2012-01-24%20until%3A2012-01-25



*For the original version of this post, with more details, see: http://theinfobabe.blogspot.com/2011/06/twitter-rss-feed-creation-cheat-sheet.html

2 comments:

Tadmin said...

if i want make following query:

(#hagtag1) AND (hashtag2 OR keyword)

or

(#hashtag1 AND #hashtag2) OR ('two keyword').

Where is the difference with spacebar and AND?

val said...

honestly, i don't know if the rss feed would respect your groupings. i tried these two, and they seemed to work for each query, respectively. you don't seem to need an AND, it's just implied. and you use the %20 (a url-encoded space) in between terms/hashtags.

search?q=%23HASHTAG1%20KEYWORD%20OR%20%23HASHTAG2
search?q=KEYWORD%20OR%20%23HASHTAG1%20%23HASHTAG2

Post a Comment