0
votes

Hi I am getting the error:

Invalid pagination mode.

in my code below(in python/Anaconda), can someone help me with this?

import sys
import tweepy as tw
from twitter import *
from tweepy import Cursor


def twitterAuth():
  # I have added the accessToken here 

    t = Twitter(
            auth=OAuth(accessToken, accessSecret, consumerKey, consumerSecret))
    return t


client = twitterAuth()

client.statuses.home_timeline()
for tweets in tw.Cursor(client.search,
          q=search_words,
          lang="en",
          since=date_since).items(5):
 print(tweets.text)

Error : File "/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 786, in runfile execfile(filename, namespace)

File "/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

line 38, in since=date_since).items(5):

File "/anaconda3/lib/python3.7/site-packages/tweepy/cursor.py", line 21, in init raise TweepError('Invalid pagination mode.')

TweepError: Invalid pagination mode.

1
Please add full error traceback to your question.Masoud Rahimi

1 Answers

0
votes

I found the answer :)

instead of using Twitter function I used tweepy

 t = tw.OAuthHandler(consumerKey, consumerSecret)
 t.set_access_token(accessToken, accessSecret)

thanks