New README
This commit is contained in:
parent
5f63187ca2
commit
174e0bc045
1 changed files with 18 additions and 30 deletions
48
README
48
README
|
|
@ -1,50 +1,38 @@
|
||||||
Tango - Easy Twitter utilities for Django-based applications
|
Tango - Easy Twitter utilities in Python
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
As a Django user, I've often wanted a way to easily implement Twitter scraping calls in my applications.
|
I wrote Tango because I found that other Python Twitter libraries weren't that up to date. Certain
|
||||||
I could write them from scratch using the already existing (and quite excellent) library called
|
things like the Search API, OAuth, etc, don't seem to be fully covered. This is my attempt at
|
||||||
"Python-Twitter" (http://code.google.com/p/python-twitter/)...
|
a library that offers more coverage.
|
||||||
|
|
||||||
However, Python-Twitter doesn't (currently) handle some things well, such as using Twitter's
|
This is my first library I've ever written in Python, so there could be some stuff in here that'll
|
||||||
Search API. I've found myself wanting a largely drop-in solution for this (and other)
|
make a seasoned Python vet scratch his head, or possibly call me insane. It's open source, though,
|
||||||
problems...
|
and I'm open to anything that'll improve the library as a whole.
|
||||||
|
|
||||||
Thus, we now have Tango.
|
OAuth support is in the works, but every other part of the Twitter API should be covered. Tango
|
||||||
|
handles both Baisc (HTTP) Authentication and OAuth, and OAuth is the default method for
|
||||||
|
Authentication. To override this, specify 'authtype="Basic"' in your tango.setup() call.
|
||||||
|
|
||||||
|
Documentation is forthcoming, but Tango attempts to mirror the Twitter API in a large way. All
|
||||||
|
parameters for API calls should translate over as function arguments.
|
||||||
|
|
||||||
Installation
|
Requirements
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
You can install this like any other Django-app; just throw it in as a new app, register it in your
|
|
||||||
settings as an "Installed App", and sync the models.
|
|
||||||
|
|
||||||
Tango requires (much like Python-Twitter, because they had the right idea :D) a library called
|
Tango requires (much like Python-Twitter, because they had the right idea :D) a library called
|
||||||
"simplejson" - Django should include this by default, but if you need the library for any reason,
|
"simplejson". You can grab it at the following link:
|
||||||
you can grab it at the following link:
|
|
||||||
|
|
||||||
http://pypi.python.org/pypi/simplejson
|
http://pypi.python.org/pypi/simplejson
|
||||||
|
|
||||||
Tango also works well as a standalone Python library, so feel free to use it however you like.
|
|
||||||
|
|
||||||
|
|
||||||
Example Use
|
Example Use
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
An extremely generic, and somewhat useless, demo is below. Instantiate your class by passing in a
|
import tango
|
||||||
Twitter username, then all functions will come off of that. Results are returned as a list.
|
|
||||||
|
|
||||||
testList = tango.setup(username="ryanmcgrath")
|
twitter = tango.setup(authtype="Basic", username="example", password="example")
|
||||||
newTestList = testList.getSearchTimeline("b", "20")
|
twitter.updateStatus("See how easy this was?")
|
||||||
for testTweet in newTestList:
|
|
||||||
print testTweet
|
|
||||||
|
|
||||||
|
|
||||||
Questions, Comments, etc?
|
Questions, Comments, etc?
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
I want to note that Tango is *not* like other Twitter libraries - we don't handle authentication or
|
My hope is that Tango is so simple that you'd never *have* to ask any questions, but if
|
||||||
anything of the sort (yet); there are already battle-tested solutions out there for both Basic Auth and
|
|
||||||
OAuth. This isn't production ready quite yet.
|
|
||||||
|
|
||||||
Tango will (hopefully) be compatible with Python 3; as it stands, I think it might be now, I've just
|
|
||||||
not had the time to check over it.
|
|
||||||
|
|
||||||
My hope is that Tango is so plug-and-play that you'd never *have* to ask any questions, but if
|
|
||||||
you feel the need to contact me for this (or other) reasons, you can hit me up
|
you feel the need to contact me for this (or other) reasons, you can hit me up
|
||||||
at ryan@venodesigns.net.
|
at ryan@venodesigns.net.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue