A rudimentary Twitter scrape/API
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
latest.py
readme.md
search.py
twitter-scrape.py
unauth.py
unauth_logo.png
user.py

readme.md

#Twitter unAuth ###So, Twitter changed they way they deliver page content, making this kind of worthless. But I have adapted: https://github.com/cosmocatalano/tweet-2-json unauth logo by me. hope it becomes a thing

These Python scripts return wads of JSON from twitter.com based on usernames and strings. Those JSON objects can be programmatically processed in applications more or less in the same way as an API return.

They should also return errors as valid JSON objects. I make no guarantees on this.

This requires Beautiful Soup 4 and a bunch of other things that probably came with your installation of Python.

There are three methods:

#The Latest Method

Returns the most recent tweet for a given user. If the given number is one, use the latest method instead

twitter-scrape/latest?name=[username]

Try it out: http://cosmocatalano.com/lab/twitter-scrape/latest?name=@cosmocatalano

#The User Method Returns a certain number of tweets from a given user. If that certain number is one, use the Latest method; it's much faster. If that number is NULL, you'll get about 20 items and it will take forever.

twitter-scrape/user?name=[username](&[integer])

Try it out: http://cosmocatalano.com/lab/twitter-scrape/user?name=@cosmocatalano&6

#The Search Method Returns a certain number of tweets containing a string. May be real time or not, though I'm not especially clear on the distinction. Again, returns about 20 items if no integer is used.

twitter-scrape/search?query=[string](&[integer], defaults to all)(&['realtime'], default not realtime)

Try it out: http://cosmocatalano.com/lab/twitter-scrape/search?query=obama&2&realtime

#Known Issues Cache buster is ineffective.