{"id":19687868,"url":"https://github.com/engali94/twitter-account-analyzer","last_synced_at":"2025-04-29T08:34:19.853Z","repository":{"id":149623205,"uuid":"232286204","full_name":"engali94/Twitter-Account-Analyzer","owner":"engali94","description":"Using various Python libraries such as Pandas, tweetPy, JSON ans matplotLib to take a sneak peek on your Twitter account using Google Colab.","archived":false,"fork":false,"pushed_at":"2020-08-25T22:04:44.000Z","size":41,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T14:03:30.259Z","etag":null,"topics":["data-analysis","data-visualization","python3","twitter-api","twitter-sentiment-analysis","twitter-streaming-api"],"latest_commit_sha":null,"homepage":"https://www.alihilal.com/projects","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/engali94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T09:08:54.000Z","updated_at":"2024-12-18T21:06:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdd5d872-5acf-452b-beac-513b906f8ede","html_url":"https://github.com/engali94/Twitter-Account-Analyzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FTwitter-Account-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FTwitter-Account-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FTwitter-Account-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FTwitter-Account-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/engali94","download_url":"https://codeload.github.com/engali94/Twitter-Account-Analyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465150,"owners_count":21593836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-visualization","python3","twitter-api","twitter-sentiment-analysis","twitter-streaming-api"],"created_at":"2024-11-11T18:36:22.266Z","updated_at":"2025-04-29T08:34:19.841Z","avatar_url":"https://github.com/engali94.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitter Account Data Analysis\n\nUsing various Python libraries such as Pandas, tweetPy, JSON and matplotLib to take a sneak peek on your Twitter account using Google Colab.\n\n\n# Setup\n\n#### Open Google Colab and import the required Libs\n``` python\n    from google.colab import drive # to mount Google Drive to Colab notebook\n    import tweepy # Python wrapper around Twitter API\n    import json\n    import pandas as pd\n    import csv\n    from datetime import date\n    from datetime import datetime\n    import time\n    import matplotlib.pyplot as plt\n```\n#### Mounting Google Drive\n\ncreate a new folder name it `dataset` then another inside it with `twitter_analysis` **Yo can change the directory as you like**\n``` python\n    drive.mount('/content/gdrive')\n    path = './gdrive/My Drive/datasets/twitter_analysis/'\n    #Follow the popup link and complete the autuorization  process\n```\n\n#  Twitter Data Collection\n\n#### Login\nIn this section you  need to get your Twitter API  credentials then  load Twitter API secrets from an external file\n``` python\n    secrets = json.loads(open(path + 'secrets.json').read())\n    consumer_key = secrets['consumer_key']\n    consumer_secret = secrets['consumer_secret']\n    access_token = secrets['access_token']\n    access_token_secret = secrets['access_token_secret']\n    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)\n    auth.set_access_token(access_token, access_token_secret)\n    api = tweepy.API(auth)\n```\n####  Helper Functions\n-  `save_json(file_name, file_content)`: Helper function to save data into a JSON file.\n-  `file_name`: the name of the data file you want to save on your Google Drive\n-  `file_content`: the data you want to save.\n-  `limit_handled(cursor, list_name)`  Helper function to handle twitter API rate limit.\n\n#### Data Collection Functions\n-   `get_all_tweets(screen_name)` : Helper function to get all tweets for a specified user and write it to a csv file.\n- `todays_stats(dict_name)` :  Helper function to get today's numbers of followers and friends and store them into a JSON file.\n- `get_followers()`:  Helper function to load follower objects into a list and save them into a JSON file.\n- `get_friends()`:  Load friends into list\n\n\n\n# Analyzing tweets\n- Load saved data from Google Drive\n- Classify tweets\n\n![Classification](https://github.com/engali94/Twitter-Account-Analysis/blob/master/assets/classification.png)\n\n# Other Features \n - Analyzing followers\n\n -  Analyzing following \n\n -  Analyzing History\n\n\n## About The Author\n- [blog](https://www.alihilal.com/blog)\n- [Twitter](https://twitter.com/alihilal94)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengali94%2Ftwitter-account-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengali94%2Ftwitter-account-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengali94%2Ftwitter-account-analyzer/lists"}