Presentation

26 views
Skip to first unread message

CreativeConvergence

unread,
Aug 28, 2009, 3:34:32 AM8/28/09
to Twython Talk
Hi,
I'm a software developper mainly interested in Django/Pinax/Satchmo
these days.
I first downloaded twython when I saw that it supported more API than
python-twitter.
Also python-twitter is returning more and more error 400 with simple
scripts I'm not sure why.
The first script I will be doing in twython is to backup and delete
all my tweets.

F.R.

Ryan McGrath

unread,
Aug 29, 2009, 2:02:17 AM8/29/09
to Twython Talk
Hey F.R,

That's awesome! Glad to hear you like Twython. Feel free to show off
anything you build with it! ;)

- Ryan

Frédéric Roland

unread,
Aug 30, 2009, 6:58:52 PM8/30/09
to twytho...@googlegroups.com
Hi Ryan,
I'm having strange result with a very simple script and don't know
what to do to fix my problem.

I've pulled the last version from git and installed twython.

Here is my script and the result when I launch it:

# -*- coding: utf-8 -*-
import twython

""" Instantiate Tango with no Authentication """
twitter = twython.setup(username="<removed>", password="<removed>")
timeline = twitter.getUserTimeline()
for machin in timeline:
twitter.destroyStatus(int(machin['id']))

examples roland$ python search_results.py
Traceback (most recent call last):
File "search_results.py", line 5, in <module>
twitter = twython.setup(username="<removed>", password="<removed>")
AttributeError: 'module' object has no attribute 'setup'

Frederic

Le 29-août-09 à 08:02, Ryan McGrath a écrit :

Kulbir Saini

unread,
Aug 30, 2009, 7:05:37 PM8/30/09
to twytho...@googlegroups.com
Hi Frederic,

     I think twython (pulled) is there in the directory from which are you running that search program. In that case twython setup function will be accessible via twython.twython.setup . Move your search_results.py to a higher directory in the hierarchy and try exectuing.

2009/8/31 Frédéric Roland <fro...@gmail.com>



--
Thank you,
Kulbir Saini.

Home-Page : http://saini.co.in/ | Blog : http://gofedora.com/
VideoCache Project : http://cachevideos.com/

Frédéric Roland

unread,
Aug 30, 2009, 7:15:13 PM8/30/09
to twytho...@googlegroups.com
Hi Kulbir,

Thank you very much !

Now it's going a bit further. It crash with the following message:

twython roland$ python search_results.py


Traceback (most recent call last):

File "search_results.py", line 8, in <module>
twitter.destroyStatus(int(machin['id']))
File "/Users/roland/Development/twitter/twython/twython.py", line
490, in destroyStatus
return simplejson.load(self.opener.open("http://twitter.com/status/destroy/
%s.json", "POST" % id))
TypeError: not all arguments converted during string formatting

I have simplejson installed but when I do python setup.py install on
twython I get an error related to json and a wrong release number.
Could that be related ?

How did you installed json ?

Frédéric


Le 31-août-09 à 01:05, Kulbir Saini a écrit :

Kulbir Saini

unread,
Aug 30, 2009, 7:26:05 PM8/30/09
to twytho...@googlegroups.com
Hi Frederic,

   Thats not your fault. Thats a bug in twython. I think Ryan should apply the attached patch to git tree.

    For the time being you have two options.
    1. Apply the attached patch to your twython.py
    2. Download the attached twython.py and replace your twython.py with it.

2009/8/31 Frédéric Roland <fro...@gmail.com>

Hi Kulbir,

Thank you very much !

Now it's going a bit further. It crash with the following message:

twython roland$ python search_results.py

Traceback (most recent call last):
 File "search_results.py", line 8, in <module>

   twitter.destroyStatus(int(machin['id']))
 File "/Users/roland/Development/twitter/twython/twython.py", line 490, in destroyStatus
   return simplejson.load(self.opener.open("http://twitter.com/status/destroy/%s.json", "POST" % id))
twython.patch
twython.py

Frédéric Roland

unread,
Aug 30, 2009, 7:47:08 PM8/30/09
to twytho...@googlegroups.com
Hi Kulbir,

I think you meant

return
simplejson.load(self.opener.open("http://twitter.com/status/destroy/
%s.json" % id, "POST"))

which is working for me.

Now I can hit the APILimit rather quickly.

Is anyone on the list know how quick twitter answer api limit lift
request ?

Frédéric

Le 31-août-09 à 01:26, Kulbir Saini a écrit :

> Hi Frederic,
>

> <twython.patch><twython.py>

Kulbir Saini

unread,
Aug 30, 2009, 7:49:01 PM8/30/09
to twytho...@googlegroups.com
Hi!

    If you get api limit lift, please let me know. I'll be interested for applying.

2009/8/31 Frédéric Roland <frederi...@creativeconvergence.info>

Hi Kulbir,

I think you meant

                              return simplejson.load(self.opener.open("http://twitter.com/status/destroy/%s.json" % id, "POST"))


which is working for me.

Now I can hit the APILimit rather quickly.

Is anyone on the list know how quick twitter answer api limit lift request ?

Frédéric

Le 31-août-09 à 01:26, Kulbir Saini a écrit :

Hi Frederic,

  Thats not your fault. Thats a bug in twython. I think Ryan should apply the attached patch to git tree.

   For the time being you have two options.
   1. Apply the attached patch to your twython.py
   2. Download the attached twython.py and replace your twython.py with it.

2009/8/31 Frédéric Roland <fro...@gmail.com>

Hi Kulbir,

Thank you very much !

Now it's going a bit further. It crash with the following message:

twython roland$ python search_results.py

Traceback (most recent call last):
 File "search_results.py", line 8, in <module>

  twitter.destroyStatus(int(machin['id']))
 File "/Users/roland/Development/twitter/twython/twython.py", line 490, in destroyStatus
  return simplejson.load(self.opener.open("http://twitter.com/status/destroy/%s.json", "POST" % id))
<twython.patch><twython.py>

Reply all
Reply to author
Forward
0 new messages