Questions tagged [python-twitter]

A Python wrapper around the Twitter API

This library provides a pure Python interface for the Twitter API.

Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use.

151 questions
1
vote
0 answers

Using python-twitter, connection with Streaming API drops off after ~5 mins

I am using python-twitter with the Twitter Streaming API to try and collect tweets from the UK which are about a particular topic. The loop I'm using is: while True: try: for item in api.GetStreamFilter(locations = UK_BB, stall_warnings…
1
vote
1 answer

How to get twitter mentions using Python-Twitter to do something

I am using Python-twitter Arduino to turn on a light on the Arduino board when someones does a mention to an specific user in twitter. I am able to do turn on the light if I use my username and use the this status = api.GetUserTimeline('username') I…
1
vote
0 answers

Pull Twitter User ID Of User That RTs/ Favs Tweet Of Another User

I'm attempting to build a twitter bot that will tweet to anyone that RTs or Favourites a tweet of another account. Is it possible using the streaming API to monitor another accounts tweets and pull the User ID and then use that to tweet at them?…
MikeyJck
  • 11
  • 1
1
vote
0 answers

Using the twitter API in Django

I've been using python twitter tools to automate stuff (automatically add tweets to favourite etc.). This is very useful, so I thought i'd turn it into an open-source program called "Mojito". Problem is i'm not an expert in python/django, and i'm…
Francois
  • 21
  • 7
1
vote
1 answer

Python-twitter library "Unable to load a json library"

I am using the following code with Python 3.3 modules (installed using Pip3.3): import simplejson import httplib2 import twitter api = twitter.Api(consumer_key='', consumer_secret='', …
gdogg371
  • 3,879
  • 14
  • 63
  • 107
1
vote
0 answers

Python: how to repeat an entry of a pandas dataframe

I am new to Python and pandas, and I have the codes like the one that's below: for line in TWITTER_USER_IDs: screen_name = line start = api.GetUser(screen_name) friends_object = api.GetFriendIDs(start) followers_object =…
Jin-Dominique
  • 3,043
  • 6
  • 19
  • 28
1
vote
1 answer

Testing the twitter app on local server in django with twython

I am using the twython library, to do handshakes with twitter python library. And I am testing things on my local server, 127.0.0.1:8000 This is my first django view, that generates the twitter tokens for users. def twitter_auth(request): """ …
user2499817
  • 77
  • 1
  • 7
1
vote
1 answer

Twitter Random Rate Limiting

I am trying to retrieve user Friend network using python-twitter API. I am using the getFriendIDs() method which retrieves the ids of all the accounts a particular twitter user is following. The following is a small snipped of my test code: for item…
anonuser0428
  • 11,789
  • 22
  • 63
  • 86
1
vote
0 answers

Getting {"errors":[{"message":"Bad Authentication data","code":215}]} using python-twitter API v1.0

I am using python-twitter API v1.0. It says that it works with v1.1 of the twitter API. This is my code : import json import urllib2 import urllib import csv file1 = open("somez.csv", "wb") fname="tw1.txt" file=open(fname,"r") ins = open( "tw1.txt",…
diggy
  • 351
  • 1
  • 5
  • 23
1
vote
1 answer

How to get latest tweet id, using python-twitter search API

I'm trying to find a way to NOT get the same tweets using search API. That's what I'm doing: make a request to the Twitter Store Tweets make another request to the Twitter Store Tweets, Compare results from 2 and 4 Ideally in step 5 I would get 0,…
Vor
  • 33,215
  • 43
  • 135
  • 193
1
vote
1 answer

GetSearch or SreamListener? python

I'm very new to twitter api, please help me understand the difference between two things. As far as I understand I can get real-time tweets by using tweepy for example : hashtag = ['justinbieber'] class CustomStreamListener(tweepy.StreamListener): …
Vor
  • 33,215
  • 43
  • 135
  • 193
1
vote
2 answers

Searching for Chinese text throws UnicodeEncodeError

I'm using python-twiter to search for tweets using Twitter's API and I have a problem with chinese terms. Here is a minimal code sample to reproduce the problem: # -*- coding: utf-8 -*- import twitter api = twitter.Api(consumer_key = "...",…
piokuc
  • 25,594
  • 11
  • 72
  • 102
1
vote
1 answer

use python-twitter to retrieve screen_name for valid email

I am trying to leverage the python-twitter wrapper to convert email addresses to twitter username. So far I am trying to the code below but getting an error that states "Sorry, that page does not exist code 34". I am using the latest version of…
AAA
  • 2,388
  • 9
  • 32
  • 47
1
vote
2 answers

Django and python-twitter error

I'm trying to send my title post to twitter. In my local machine, this is working great, but in the remote machine, I have this error from the snippet file: AttributeError: 'module' object has no attribute 'Api' I'm using python-twitter and this…
Asinox
  • 6,747
  • 14
  • 61
  • 89