skip to Main Content

Post tweets using tweepy and Twitter API V2

I need my Twitter app to tweet some information, but something is going wrong. First, I created an app and tried this code to test credentials: auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET") auth.set_access_token("ACCESS_TOKEN", "ACCESS_SECRET") api = tweepy.API(auth) try: api.verify_credentials() print("Authentication Successful") except:…

VIEW QUESTION

Twitter API V2 403: Forbidden using tweepy

I'm not able to authenticate using my twitter developer account even though my account active import tweepy consumer_key= 'XX1' consumer_secret= 'XX2' access_token= 'XX3' access_token_secret= 'XX4' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) api.update_status("Hello Tweepy") i'm getting error :…

VIEW QUESTION

How to download a file that was sent to my bot? – Telegram API

@dp.message_handler(content_types=types.ContentType.DOCUMENT) async def scan_message(file: types.File): print("downloading document") file_path = file.file_path destination = r"C:usersaleksPycharmProjectspythonProjectfile.pdf" destination_file = bot.download_file(file_path, destination) print("success") I would like to be able to download a file (in this case it is pdf) that was sent to my bot…

VIEW QUESTION

Creating a python package (deb/rpm) from cmake – Debian

I am trying to create a python package (deb & rpm) from cmake, ideally using cpack. I did read https://cmake.org/cmake/help/latest/cpack_gen/rpm.html and, https://cmake.org/cmake/help/latest/cpack_gen/deb.html The installation works just fine (using component install) for my shared library. However I cannot make sense of…

VIEW QUESTION

Apache + Django on Windows does not start

I am trying to set up Apache with Django on Windows but it does not seem to work. My settings.py ALLOWED_HOSTS = ['localhost', '127.0.0.1'] My wsgi.py import os import sys from django.core.wsgi import get_wsgi_application from pathlib import Path # Add…

VIEW QUESTION

The Error tweepy.errors.Forbidden: 403 Forbidden – Twitter API

import tweepy print("This is a twitter Bot") apiKey="XXXXXXXXXXXXXXXXXXX" apiKeySecret="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" accessToken="1111111111111111111111111111111111111" accessTokenSecret="222222222222222222222222222222222222" auth=tweepy.OAuthHandler(apiKey,apiKeySecret) auth.set_access_token(accessToken,accessTokenSecret) api=tweepy.API(auth) api.update_status('Twitter Bot In Action')

VIEW QUESTION
Back To Top
Search