Comments (6)
I think we need a more pluggable HTTP layer in general. There are a number of
things
that the user can't control right now that makes it difficult.
Original comment by dclinton
on 26 Oct 2008 at 4:22
- Changed state: Accepted
from python-twitter.
This will be addressed post 0.6 when we overhaul the HTTP layer to support
OAuth.
Original comment by dclinton
on 21 Feb 2009 at 5:21
from python-twitter.
I add proxy support with authentification for python-twitter 0.5
Here is the code of Opener:
def _GetOpener(self, url, username=None, password=None, proxy_username=None,
proxy_password=None, proxy_host=None, proxy_port=None):
if username and password:
#self._AddAuthorizationHeader(username, password)
handler = self._urllib.HTTPBasicAuthHandler();
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(url)
handler.add_password(Api._API_REALM, netloc, username, password)
if proxy_username and proxy_password and proxy_host and proxy_port:
proxyinfo = {
'user' : proxy_username,
'pass' : proxy_password,
'host' : proxy_host,
'port' : proxy_port
}
proxyhandler = self._urllib.ProxyHandler({"http" : \
"http://%(user)s:%(pass)s@%(host)s:%(port)d" % proxyinfo})
opener = self._urllib.build_opener(proxyhandler, handler)
else:
opener = self._urllib.build_opener(handler)
self._urllib.install_opener(opener)
else:
opener = self._urllib.build_opener()
self._urllib.install_opener(opener)
opener.addheaders = self._request_headers.items()
return opener
Unfortunately, this code doesnt allow use proxy without authorization in
Twitter.
I attach modified twitter.py (0.5) with proxy support.
Original comment by [email protected]
on 30 Jul 2009 at 5:22
Attachments:
from python-twitter.
to be applied to dev branch
Original comment by bear42
on 16 May 2010 at 11:40
- Added labels: milestone-dev
from python-twitter.
The use of urllib2 has changed considerably since 0.5/0.6. I created a clone of
0.8.1 that supports proxy authentication (and a socket timeout).
http://code.google.com/r/michaelscovetta-auth-proxy-support/source/browse
Original comment by [email protected]
on 24 Jan 2011 at 7:07
from python-twitter.
Dear Michael,
Thank you very much Mr. Michael for your code which handles the issues of proxy.
regards
avijit
Original comment by [email protected]
on 7 Nov 2013 at 6:17
from python-twitter.
Related Issues (20)
- Character Limit does not accurately match URL t.co wrapper
- NewFromJsonDict AttributeError HOT 2
- "UnicodeEncodeError: 'ascii' codec can't encode characters" during GetSearch() for utf-8 encoded search terms
- Current head (dca91beb7418) has a failing unit test HOT 1
- 404 - Dependency issue? HOT 1
- README.md did not get up to speed HOT 1
- Pip Install from source fails (google code) HOT 3
- api.GetMentions errors HOT 1
- import twitter produces AttributeError: 'module' object has no attribute 'Http' HOT 1
- Getting {“errors”:[{“message”:“Bad Authentication data”,“code”:215}]} using python-twitter API v1.0 HOT 5
- Direct Messages failing HOT 3
- GetPublicTimeline() is referenced in docs but not implemented HOT 1
- python 3.x HOT 2
- GetUser gives a "page does not exist 34" HOT 2
- remove dependency to python-oauth2 switch to oauthlib HOT 2
- GetUserTimeLine does not work
- status of python-twitter-1.1
- api.CreateList returns UnboundLocalError
- Cannot be installed with Pip HOT 2
- User behind a proxy will face a problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-twitter.