Remove httplib2 dependency, remove "shortenUrl" function, no need for urllib2 either
* Removed shortenUrl since Twitter ALWAYS shortens the URL to a t.co, anyways. * Since removing shortenUrl, no need for urllib2 anymore * No need for httplib2 anymore, either
This commit is contained in:
parent
8630dc3f03
commit
158bf77231
2 changed files with 24 additions and 43 deletions
49
setup.py
49
setup.py
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys, os
|
||||
from setuptools import setup
|
||||
from setuptools import find_packages
|
||||
|
||||
|
|
@ -8,31 +7,31 @@ __author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
|||
__version__ = '1.4.6'
|
||||
|
||||
setup(
|
||||
# Basic package information.
|
||||
name = 'twython',
|
||||
version = __version__,
|
||||
packages = find_packages(),
|
||||
# Basic package information.
|
||||
name='twython',
|
||||
version=__version__,
|
||||
packages=find_packages(),
|
||||
|
||||
# Packaging options.
|
||||
include_package_data = True,
|
||||
# Packaging options.
|
||||
include_package_data=True,
|
||||
|
||||
# Package dependencies.
|
||||
install_requires = ['simplejson', 'oauth2', 'httplib2', 'requests'],
|
||||
# Package dependencies.
|
||||
install_requires=['simplejson', 'oauth2', 'requests', 'requests-oauth'],
|
||||
|
||||
# Metadata for PyPI.
|
||||
author = 'Ryan McGrath',
|
||||
author_email = 'ryan@venodesigns.net',
|
||||
license = 'MIT License',
|
||||
url = 'http://github.com/ryanmcgrath/twython/tree/master',
|
||||
keywords = 'twitter search api tweet twython',
|
||||
description = 'An easy (and up to date) way to access Twitter data with Python.',
|
||||
long_description = open('README.markdown').read(),
|
||||
classifiers = [
|
||||
'Development Status :: 4 - Beta',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
'Topic :: Communications :: Chat',
|
||||
'Topic :: Internet'
|
||||
]
|
||||
# Metadata for PyPI.
|
||||
author='Ryan McGrath',
|
||||
author_email='ryan@venodesigns.net',
|
||||
license='MIT License',
|
||||
url='http://github.com/ryanmcgrath/twython/tree/master',
|
||||
keywords='twitter search api tweet twython',
|
||||
description='An easy (and up to date) way to access Twitter data with Python.',
|
||||
long_description=open('README.markdown').read(),
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
'Topic :: Communications :: Chat',
|
||||
'Topic :: Internet'
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ __author__ = "Ryan McGrath <ryan@venodesigns.net>"
|
|||
__version__ = "1.4.6"
|
||||
|
||||
import urllib
|
||||
import urllib2
|
||||
import re
|
||||
import inspect
|
||||
import time
|
||||
|
|
@ -31,7 +30,6 @@ except ImportError:
|
|||
# table is a file with a dictionary of every API endpoint that Twython supports.
|
||||
from twitter_endpoints import base_url, api_table
|
||||
|
||||
from urllib2 import HTTPError
|
||||
|
||||
# There are some special setups (like, oh, a Django application) where
|
||||
# simplejson exists behind the scenes anyway. Past Python 2.6, this should
|
||||
|
|
@ -272,22 +270,6 @@ class Twython(object):
|
|||
def constructApiURL(base_url, params):
|
||||
return base_url + "?" + "&".join(["%s=%s" % (Twython.unicode2utf8(key), urllib.quote_plus(Twython.unicode2utf8(value))) for (key, value) in params.iteritems()])
|
||||
|
||||
@staticmethod
|
||||
def shortenURL(url_to_shorten, shortener="http://is.gd/api.php", query="longurl"):
|
||||
"""shortenURL(url_to_shorten, shortener = "http://is.gd/api.php", query = "longurl")
|
||||
|
||||
Shortens url specified by url_to_shorten.
|
||||
|
||||
Parameters:
|
||||
url_to_shorten - URL to shorten.
|
||||
shortener - In case you want to use a url shortening service other than is.gd.
|
||||
"""
|
||||
try:
|
||||
content = urllib2.urlopen(shortener + "?" + urllib.urlencode({query: Twython.unicode2utf8(url_to_shorten)})).read()
|
||||
return content
|
||||
except HTTPError, e:
|
||||
raise TwythonError("shortenURL() failed with a %s error code." % e.code)
|
||||
|
||||
def bulkUserLookup(self, ids=None, screen_names=None, version=1, **kwargs):
|
||||
""" bulkUserLookup(self, ids = None, screen_names = None, version = 1, **kwargs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue