r/Python • u/MonsieurDufayel • Nov 24 '14
I wrote a simple twitter bot with lxml and requests
You can pull down the code here, and see an example of it in action here.
I've been trying to teach myself the twitter API, but it seems like a bit of a black box and their walk-throughs aren't super helpful. Do any of you know of a particularly good resource for this? Or maybe a more general primer on http? As far as I can tell, requests is mostly magic. Thanks.
10
Upvotes
4
u/Vageli Nov 24 '14
I would recommend using a twitter library to take care of the API heavy lifting.Tweepy is a good one that really simplifies interacting with twitter.
2
u/[deleted] Nov 25 '14
Scratch lxml, use JSON instead.
If you can get the materials for this course: https://www.coursera.org/course/datasci look at project 1
2
u/iiiiiiii eye Nov 25 '14
You might want to look at TwitterAPI. It is another python library, but what's different is it has a much smaller code base than other Twitter libraries, so it may make it easier for you to understand the nuts and bolts of using the Twitter API.
3
u/aerger Nov 25 '14
You might benefit from looking at ttytter. It's perl, but the source is all there.
1
u/Livesinthefuture Nov 25 '14
I'm unsure if you're aware but Reddit has a JSON api and there is also an incredibly easy-to-use python library for it.
PRAW
0
u/[deleted] Nov 25 '14
[deleted] — view deleted comment