Many websites will be providing trendy news in any technology and the article can be rated by means of its review count. Suppose the news is for cryptocurrencies and news articles are scraped from cointelegraph.com, we can get each news item reviewer to count easily and placed in MongoDB collection.
- Tweepy: Tweepy is the Python client for the official Twitter API. Install it using following pip command:
pip install tweepy
- MongoClient: The class MongoClient enables one to make successful MongoDB server connections with your code. Install it using following pip command:
pip install pymongo
- Pyshorteners: Pyshorteners is used to shorten, brand, share, or retrieve data from links programmatically. Install it in the below ways
pip install pyshorteners
In order to fetch tweets through Twitter API, one needs to register an App through their twitter account. Follow these steps for the same:
- Open this link https://apps.twitter.com/ and click the button: ‘Create New App’
- Fill the application details. You can leave the callback url field empty.
- Once the app is created, you will be redirected to the app page.
- Open the ‘Keys and Access Tokens’ tab.
- Copy ‘Consumer Key’, ‘Consumer Secret’, ‘Access token’ and ‘Access Token Secret’ and paste them in the below code.
Below is the implementation.
Impactful News of the Day
Veteran Investor Says….https://bit.ly/2X1x51V
Bitcoin Hashrate Drops….https://bit.ly/2T83xyS
The VC Who….https://bit.ly/3czxVKb
#bitcoin #cryptocurrency #blockchain #investor #altcoins #fintech #investment
- Fetching top news using News API
- How to Scrape Web Data from Google using Python?
- Scrape Tables From any website using Python
- Tweet using Python
- Newspaper scraping using Python and News API
- Python program to Recursively scrape all the URLs of the website
- Python Tweepy – Getting the date and time when a tweet was tweeted
- Read latest news using newsapi | Python
- Python Tweepy – Getting the text of a tweet
- Python Tweepy – Getting the number of times a tweet has been retweeted
- Python Tweepy – Getting the source of a tweet
- Python Tweepy – Getting the number of times a tweet has been favourited
- Python Tweepy – Checking whether a tweet has been liked or not
- Python Tweepy – Checking whether a tweet has been retweeted or not
- Python Tweepy – Getting the language of a tweet
- Scrape content from dynamic websites
- Python Desktop News Notifier in 20 lines
- Python | Django News App
- The most occurring number in a string using Regex in python
- Python | Program to crawl a web page and get most frequent words
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.