Skip to content

Alfareiza/scrap-western-currency-and-tweet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrap Western Union Currency

Twitter Bot

GitHub followers

Python License contributions welcome Twitter

I followed this documentation, How to make a twitter bot for free in order to configure the lambda service that make the post of the tweet.

In the other hand, the main.py file is responsible for scraping the site, write the information into a file located at S3 Bucket, and call the AWS API Gateway. So, this module is executed on replit.com and stay alive thanks to uptimerobot.com. According to this, if the AWS API is triggered, the AWS Lambda function will be executed and the tweet will be posted.

Stack of Libraries

  • Atexit: It is executed, in case of the interpreter stop (built-in library).
  • Boto3: Read, Write and Update the information on the bucket.
  • Httpx: Make a GET request to an AWS API Gateway in order to make the tweet.
  • Selenium: Scrap the site.
  • Rocketry: Schedule the task to make all the process.
  • Tweepy: Handle the twitter api. So, It post the tweet.

Stack of Technologies

  • Replit: Hold the project online.
  • Uptimerobot: Keep the project alive using the replit url, previously generated with Flask.
  • AWS Lambda: Handle the possibility of post the tweet, reading the bucket for updated information.
  • AWS S3: Store the csv file with the scraped information.
  • AWS API Gateway: Trigger that call de AWS Lambda function.

Illustrations of the flow

scrap-western-currency-and-twee-page1

scrap-western-currency-and-twee-page2

Examples

Posting a graphic

image

Posting a tweet

image

Posting a tweet with a different text

image