https://github.com/vinitshahdeo/jobtweets
:mag: This project is about searching the twitter for job opportunities using popular hashtags and applying sentiment analysis on this. :hash: :bird:
https://github.com/vinitshahdeo/jobtweets
hashtag job-opportunities jobs jobsearch python sentiment-analysis textblob tweepy tweets twitter twitter-api twitter-sentiment-analysis
Last synced: 8 months ago
JSON representation
:mag: This project is about searching the twitter for job opportunities using popular hashtags and applying sentiment analysis on this. :hash: :bird:
- Host: GitHub
- URL: https://github.com/vinitshahdeo/jobtweets
- Owner: vinitshahdeo
- License: mit
- Created: 2017-05-03T23:35:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T18:46:48.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T09:03:40.160Z (about 1 year ago)
- Topics: hashtag, job-opportunities, jobs, jobsearch, python, sentiment-analysis, textblob, tweepy, tweets, twitter, twitter-api, twitter-sentiment-analysis
- Language: Python
- Homepage: https://vinitshahdeo.github.io/jobtweets/
- Size: 1.36 MB
- Stars: 123
- Watchers: 2
- Forks: 83
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Job Opportunities using [Twitter](https://twitter.com/Vinit_Shahdeo)
## Twitter Sentiment Analysis using Python
[](https://github.com/vinitshahdeo/jobtweets)
[](https://twitter.com/Vinit_Shahdeo) [](https://github.com/vinitshahdeo/jobtweets/raw/master/report/REPORT.pdf)
#### The project is about searching the twitter for job opportunities using popular [#hashtags](https://twitter.com/search?q=%23jobs&src=typd) and applying sentiment analysis on this.
[](https://github.com/vinitshahdeo/) [](https://github.com/vinitshahdeo/) [](https://github.com/vinitshahdeo/)
#### Few popular [#hashtags](https://twitter.com/Vinit_Shahdeo)
[](https://vinitshahdeo.github.io/jobtweets/) [](https://vinitshahdeo.github.io/jobtweets/) [](https://vinitshahdeo.github.io/jobtweets/)
[](https://vinitshahdeo.github.io/jobtweets/) [](https://vinitshahdeo.github.io/jobtweets/) [](https://vinitshahdeo.github.io/jobtweets/)
### Motivation
Twitter is all about enabling users to send out brief messages to large audiences. If you haven’t been taking advantage of Twitter as a job search tool, it’s time to jump in. When used intelligently, Twitter can have a profound impact on your job search success – or lack thereof. Small steps can help you turn Twitter into your own personal job search platform. Try them today and see what a difference they make in your overall job search success.
### About the Project
#### What is Sentiment Analysis?
Sentiment Analysis is the process of ‘computationally’ determining whether a piece of writing is positive, negative or neutral. It’s also known as opinion mining, deriving the opinion or attitude of a speaker.
#### Steps involved in this project
3 major steps in `jobtweets.py` code :
1. Authorize twitter API client.
2. Make a GET request to Twitter API to fetch tweets for a particular query.
3. Parse the tweets. Classify each tweet as positive, negative or neutral.
[](https://github.com/vinitshahdeo/jobtweets) [](https://github.com/vinitshahdeo) [](https://github.com/vinitshahdeo)
#### Explanation
- First of all, I've created a **TwitterClient** class. This class contains all the methods to interact with Twitter API and parsing tweets. We use `__init__` function to handle the authentication of API client.
- In **get_tweets** function, I have used `fetched_tweets = self.api.search(q = query, count = count)` to call the Twitter API to fetch tweets. 'query' is basically, the hashtags.
- In **get_tweet_sentiment** I've used textblob module.
`analysis = TextBlob(self.clean_tweet(tweet))`
- **clean_tweet** method to remove links, special characters, etc. from the tweet using some simple regex.
- I have used **sentiment.polarity** method of **TextBlob** class to get the polarity of tweet between -1 to 1.
```python
if analysis.sentiment.polarity > 0:
return 'positive'
elif analysis.sentiment.polarity == 0:
return 'neutral'
else:
return 'negative'
```
- Finally, I've printing the percentage of positive, negative and neutral tweets about a **#hashtag**(query).
**Note** - You can change the hashtags by changing `query = 'WRITE YOUR OWN HASHTAG'`
```python
tweets = api.get_tweets(query = 'Job Opportunities', count = 500)
```
### Libraries Used
[](http://docs.tweepy.org/en/v3.5.0/) [](https://textblob.readthedocs.io/en/dev/)
- [Tweepy](http://docs.tweepy.org/en/v3.5.0/) - **tweepy** is the python client for the official [Twitter API](https://developer.twitter.com/en/docs).
- [TextBlob](https://textblob.readthedocs.io/en/dev/) - **textblob** is the python library for processing textual data.
### Installation
- Install **Tweepy** using pip command: `pip install tweepy`
- Install **TextBlob** using pip command: `pip install textblob`
### How to run?
[](https://github.com/vinitshahdeo/jobtweets/)
- Get started with **Twitter API** by signing up for [Twitter Developer Account](https://dev.twitter.com/apps).
- In order to fetch tweets through **Twitter API**, you need to register an App through your twitter account.
- Follow this [link](https://apps.twitter.com/) to register your app.
- Get the API keys. Need help, follow this [link](https://themepacific.com/how-to-generate-api-key-consumer-token-access-key-for-twitter-oauth/994/)
- Open `jobtweets.py` and replace '**XXXXXXXXXXXX**' with your API keys.
```python
consumer_key = 'XXXXXXXXXXXX'
consumer_secret = 'XXXXXXXXXXXX'
access_token = 'XXXXXXXXXXXX'
access_token_secret = 'XXXXXXXXXXXX'
```
- Run `python jobtweets.py`
- It may take a minute to fetch the results from **Twitter**. Make sure that you've proper internet connection.
### Project Reports
[](https://github.com/vinitshahdeo/jobtweets/raw/master/report/presentation.pptx) [](https://github.com/vinitshahdeo/jobtweets/raw/master/report/REPORT.pdf)
- [Download](https://github.com/vinitshahdeo/jobtweets/raw/master/report/presentation.pptx) the presentation.
- [Download](https://github.com/vinitshahdeo/jobtweets/raw/master/report/REPORT.pdf) project report.
### Useful Links
- [Getting started with Twitter Developer Platform](https://developer.twitter.com/en/docs/basics/getting-started)
- [How to Install PIP for Python on Windows, Mac and Linux](https://www.makeuseof.com/tag/install-pip-for-python/)
### Related Work
[](https://github.com/vinitshahdeo/TwitterSentimentAnalysis/) [](https://github.com/vinitshahdeo/)
[Twitter Sentiment Analyzer](https://vinitshahdeo.github.io/TwitterSentimentAnalysis/) - A web app to search the keywords(Hashtags) on Twitter and analyze the sentiments of it. The source code is written in **PHP** and it performs Sentiment Analysis on Tweets by using the Datumbox API.
### Contributing
[](https://github.com/vinitshahdeo/jobtweets/pulls) [](https://github.com/vinitshahdeo/jobtweets/issues) 
[](https://github.com/vinitshahdeo/jobtweets/)
- Clone [this](https://github.com/vinitshahdeo/jobtweets/) repository:
```bash
git clone https://github.com/vinitshahdeo/jobtweets.git
```
- Check out any issue from [here](https://github.com/vinitshahdeo/jobtweets/issues).
- Make changes and send [Pull Request](https://github.com/vinitshahdeo/jobtweets/pull).
### Need help?
[](https://www.facebook.com/vinit.shahdeo) [](https://www.instagram.com/vinitshahdeo/) [](https://www.linkedin.com/in/vinitshahdeo/)
:email: Feel free to contact me @ [vinitshahdeo@gmail.com](https://mail.google.com/mail/)
[](https://www.github.com/vinitshahdeo) [](https://twitter.com/Vinit_Shahdeo)
### License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvinitshahdeo%2Fjobtweets?ref=badge_large)
MIT © [Vinit Shahdeo](https://github.com/vinitshahdeo/jobtweets/blob/master/LICENSE)
### Author
|
|
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **[Vinit Shahdeo](https://fayz.in/stories/s/1522/0/?ckt_id=ZGL1ZGVk&title=story_of_vinit_shahdeo)** |
|
|
[](https://github.com/vinitshahdeo/jobtweets/blob/master/LICENSE)
[](https://github.com/vinitshahdeo/jobtweets/network) [](https://github.com/vinitshahdeo/jobtweets/stargazers) [](https://github.com/vinitshahdeo/)
------
:hugs:
Check out my other projects here!
------