twitter list add doesn't seem to work

22 views
Skip to first unread message

Mike Borozdin

unread,
Jul 16, 2011, 8:46:58 PM7/16/11
to jt...@googlegroups.com
I am writing some code to add users to a twitter list.

Seems to be pretty straightforward, but somehow it silently fails.

TwitterList twitterList = new TwitterList(user.screenName, "just-added", twitter);
twitterList.add(new User("apigee"));
twitterList.add(new User("docusign"));

       
Any thoughts on why those wouldn't show up?  Is there a save() method I should call?

Twitter object is fully authenticated.

Daniel Winterstein

unread,
Jul 17, 2011, 4:33:53 AM7/17/11
to jt...@googlegroups.com
Your code snippet looks valid. I'll investigate what's going wrong.
One possibility is the size of the list, or the number of lists you
have - I think the limits for these are a few hundred and 20
respectively.
- Daniel

--
--------------------------------------------------
Daniel Winterstein
Edinburgh
http://winterwell.com   http://soda.sh

Daniel Winterstein

unread,
Jul 17, 2011, 6:39:22 AM7/17/11
to jt...@googlegroups.com
Hi Mike,

I think this may be confusion over the constructor.
TwitterList has 2 constructors - one is for accessing lists which
already exist on Twitter, the other
is for creating new lists.
new TwitterList(ownerScreenName, listName, twitter) accesses an existing list
new TwitterList(listName, twitter, isPublic, description) creates a new list
You're using the constructor for existing lists. If the list does not
exist, you should get a TwitterException.E404
when running your code.

The 2 constructors are documented, but I can see how it could easily
be confusing. I'm therefore going to deprecate
the constructor for accessing an existing list, and add a static
method TwitterList.get() as the preferred alternative. To be
released next month (but available from Git now).

I hope that solves your problem.

Best regards,
- Daniel


On 17 July 2011 01:46, Mike Borozdin <nolong...@gmail.com> wrote:

--

Mike Borozdin

unread,
Jul 17, 2011, 12:19:52 PM7/17/11
to jt...@googlegroups.com, jt...@googlegroups.com
Yes that fixed it. Thanks!

-mb, from my phone

Reply all
Reply to author
Forward
0 new messages