3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

くりぼっち慰めプログラム

Last updated at Posted at 2020-12-26

どうも、山田長政です
クリスマスなんでツイッターのくりぼっちツイートにいいねを押すプログラムを
作りました。

#いるもの

python
tweepy
  

#プログラム
countのとこに押す回数を入れます。

tw.py

import tweepy
from time import sleep

consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
access_token = 'xxxxxxxxxxxxxxxxxx'
access_token_secret = 'xxxxxxxxxxxxxxxxx'



auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

    
for status in api.search(q='くりぼっち', count=10000):
    tweet_id = status.id
# 例外処理をする
    try:
# いいね実行
        api.create_favorite(tweet_id)
        print("ok")
    except:
        print('error')
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?