A Twitter bot developed in Python using the Tweepy library and hosted in AWS.

Overview

Twitter Cameroon: @atangana_aron

A Twitter bot developed in Python using the Tweepy library and hosted in AWS. https://twitter.com/atangana_aron

Cost = Free!

The Bot

Yaounde (Image)

This bot will get a large sample of tweets with the word Yaoundé and then retweet the most liked tweet from the sample with an attached photo. (At present this runs only on Sundays)

Paul Biya Alert

This bot will run daily and check to see if there is an abnormally large number of relevant Tweets and then retweet the most liked tweet (if there are a lot of Tweets that day). The bot will specifically pull tweets with the word Biya and see how many of them also contain Paul.

Top 10 Words

This bot will pull a large sample of tweets with the word Cameroun (French spelling of Cameroon). For each Tweet, it removes stopwords and duplicates, then creates a bag of words counting occurrence of each word. The top 10 words are then tweeted. (At present, this runs every day except Sunday)

AWS Hosting

AWS Lambda

Lambda functions have many uses. In this case, we will use it for ultra cheap (free) hosting/computing. All work necessary in AWS to run this bot is done by navigating to Lambda in the AWS UI and creating a new function. The equivalent of main.py for a lambda function is lambda_function.py. To observe the code, start with lambda_function.py and trace its references.

Non-native Python Packages w/ Lambda

The bot relies on a non-native package (in this case Tweepy). Running the code on Lambda requires also uploading the package. This can be done in several ways, as outlined here: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Cloudwatch Events

These are the triggers that will determine when to run your lambda function. Using cron expressions, you can set this on a schedule to run at a certain time per day, day per week/month.

Twitter API

Developer API

https://developer.twitter.com/en/docs/twitter-api

Tweepy

https://www.tweepy.org/

A few highlights:

  • Max # of tweets pulled at once is 3200
  • Can both download tweets and create tweets

Running this code

API Keys

Requires your own APIKeys.py in the API folder. Generate these from the Twitter Developer API. After signing up for a developer account, create a new project and generate read/write keys. Format of APIKeys.py should be as follows:

  • Key = 'xxx'
  • Secret = 'yyy'
  • Bearer_Token = 'zzz'
  • Access_Token = '111'
  • Access_Secret = '222'

AWS

Everything in this code runs using the free tiers of AWS. You'll need to create your own account which requires attaching a valid credit card. You'll need to create the lambda function, upload the code as a zip, attach the trigger (Cloudwatch Event), and change the runtime to allow for ~30 seconds or less. You'll need to follow the instructions under the AWS Hosting section of this readme to upload the script with the necessary package, otherwise you'll receive an error stating Tweepy: no such module.

Cost

Twitter's API has a limit of number of tweets per month (using the free version). At the time of this writing, that limit is >150x the Tweepy API call limit.

AWS Lambda has a monthly compute free tier. Each run of a bot is <.1% of that limit at the time of this writing.

Owner
master's student in data science at Georgia Tech
Discord rich-presence implementation for VALORANT

not working on v1 anymore in favor of v2, but if there's any big bugs i'll try to fix them valorant-rich-presence-client Discord rich presence extensi

colinh 278 Jan 08, 2023
A Matrix-Instagram DM puppeting bridge

mautrix-instagram A Matrix-Instagram DM puppeting bridge. Documentation All setup and usage instructions are located on docs.mau.fi. Some quick links:

89 Dec 14, 2022
Lumi-Bot - Discord bot that fetches cryptocurrency prices utilizing CoinGeko API

Lumi-Bot Discord bot that fetches and monitors cryptocurrency prices utilizing C

Diego Castro 2 Oct 08, 2022
MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library

The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)

Just Some Bots 2.9k Jan 02, 2023
Telegram Client and Bot that use Artificial Intelligence to auto-reply to scammers and waste their time

scamminator Blocking a scammer is not enough. It is time to fight back. Wouldn't be great if there was a tool that uses Artificial Intelligence to rep

Federico Galatolo 6 Nov 12, 2022
This discord bot will help you to control your target through PickleC2

PickleC2-Bot This discord bot will help you to control your target through PickleC2 WHAT's a PickleC2? PickleC2 is a simple C2 framework written in py

4 Jun 25, 2022
A replacement for Reddit /r/copypasta CummyBot2000 with extra measures to avoid it being banned.

CummyBot1984 A replacement for Reddit /r/copypasta's CummyBot2000 with extra measures to respect Reddit's API rules. Features Copies and replies to ev

2 Feb 21, 2022
Install and manage Proton-GE and Luxtorpeda for Steam and Wine-GE for Lutris with this graphical user interface. Based on AUNaseef's ProtonUp, made with Python 3 and Qt 6.

ProtonUp-Qt Qt-based graphical user interface to install and manage Proton-GE installations for Steam and Wine-GE installations for Lutris. Based on A

638 Jan 02, 2023
Amazon AWS Web Tool (view only)

Amazon AWS Web Tool (AAWT) discontinued Features Cloudfront (simple) EC2 (With Charts and Prices) EC2 Reserved EBS ELB (With Charts) Obs:. only classi

Carlos Augusto Malucelli 9 Nov 07, 2022
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
One of Best renamer bot with python

🌀 One of Best renamer bot repo Please Give a ☆ if You like This Open Source and Don't Forget to Follow Me On Github For More Repos And Codes. Scrappe

1 Dec 14, 2021
Activate exitlag trial accounts

Exitlag Account Activator Activate exitlag trial accounts (unlimited trial accounts) ⭐ If you want to support me, follow me on github and star the pro

Benjamin 173 Nov 10, 2022
A multi purpose discord bot for python

Sypher The best multi purpose discord bot. Add Sypher right now Invite Me | Join

Johan Naizu 1 Dec 15, 2022
Program that uses Python to monitor grade updates in the Genesis Platform

Genesis-Grade-Monitor Program that uses Python to monitor grade updates in the Genesis Platform Guide: Install by either cloning the repo or downloadi

Steven Gatanas 1 Feb 12, 2022
An interactive and multi-function Telegram bot, made especially for Telegram groups.

PyKorone An interaction and fun bot for Telegram groups, having some useful and other useless commands. Created as an experiment and learning bot but

Amano Team 17 Nov 12, 2022
An automated, headless YouTube Uploader

An automated, headless YouTube Uploader Authors: Christian C., Moritz M., Luca S. Related Projects: YouTube Watcher, Twitch Compilation Creator, Neura

127 Dec 23, 2022
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Python package for Calendly API v2

PyCalendly Python package to use Calendly API-v2. Installation Install with pip $ pip install PyCalendly Usage Getting Started See Getting Started wi

Lakshmanan Meiyappan 20 Dec 05, 2022
Python wrapper for Revolt API

defectio is a direct implementation of the entire Revolt API and provides a way to authenticate and start communicating with Revolt servers. Similar interface to discord.py

Leon Bowie 26 Sep 18, 2022
This project, search all entities related to A2P in twilio

Mirror A2P Twilio This project, search all entities related to A2P in twilio (phone numbers, messaging services, campaign, A2P brand information and P

Iván Cárdenas 2 Nov 03, 2022