Python vraagje: proxy gebruiken

 

Gezocht: Onderstaand gedeelte moet gebruik gaan maken van een proxy (IP adres en Port) maar wat ik ook probeer, ik krijg alleen maar een negatieve response terug. Dus ergens gaat er wat mis als ik er een ProxyHandler erbij wil voegen. Iemand een idee?

self.req = None
self.req = urllib2.Request(url)
self.req.add_header(“User-agent”, programma.USERAGENT)
self.connect()

elif autosub.Helpers.checkAPICalls(use=True):
self.req = None
self.req = urllib2.Request(url)
self.req.add_header(“User-agent”, programma.USERAGENT)
self.connect()

else:
log.error(“API: out of api calls”)
 
def connect(self):
import socket
socket.setdefaulttimeout(programma.TIMEOUT)
self.resp = urllib2.urlopen(self.req)
time.sleep(5) #Max 2 connections each second

Twitter Pages

One of the things I really like is the integration of Twitter within my weblog were it is actually stored in my database. I searched for hours for a tool / plugin to embed the twitter tweets into WordPress.

For a very long time I am using ‘Thread Twitter’ an abandoned plugin. I managed to modify the code first to have the non working avatars removed and this weekend I was able to get the plugin working again cause Twitter closed the based authentication a few weeks ago. You need oauth for it.

After searching for new plugins I could not find any serving my need: put my tweets into 1 page and show the thread when someone replies or send me an tweet.

After the non successful search for a new plugin, I found out that the plugin can use an Proxy API. the Proxy API defined is not working with oauth, but thanks to SuperTweet.net I fixed my non working Thread Twitter again.
I am happy again ;-)