Skip to content

A library for automating several social media actions, such as posting, login, notifications etc. for multiple social media sites and an API free, purely selenium based solution for scraping data without using any APIs.

License

Notifications You must be signed in to change notification settings

atharva-naik/social_media

Repository files navigation

social_media

A library for automating several social media actions, such as posting, login, notifications etc. for multiple social media and scraping data from these social medias. API free (no official social media APIs used), front-end selinium based solutions only.

Social media platforms supported

Installation

Will be uploaded to PyPI soon. Some versions will be uploaded to TestPyPI

Cool updates:

20th Dec: YOU CAN NOW VIEW YOUR INSTAGRAM FEED ON THE TERMINAL NOW NOTE: (only tested for linux till now)

Some random use cases

USE CASE 1: Fetch profile of a twitter user

  1. Create twitter engine
from social_media.twitter.base import TwitterEngine
t = TwitterEngine(patience=10) # patience is in seconds

or

from social_media.base import Engine
t = Engine.select('twitter', patience=10)
  1. Login (optional)
t.login(read_from_env=True) # read from a .env file

or

t.login(username="username", email="[email protected]", contact="123456789", password="password")
"""pass the username, contact, email and password manually. 
(at least one of username, email or contact number is needed)
password is required"""
  1. Get the profile of the person
t.get_profile(username="@dannygonzalez") # I am truly greg (@ is optional, not really needed, also username should be exact)
  1. Logout (optional)
t.logout() 
  1. Close the browser window
t.close(wait_for_input=False) # if wait_for_input is true then script will wait for the user to enter q to terminate

USE CASE 2: Download a yotube playlist ("Downloading VSauce's Mind Field series")

# example to download youtube playlists
from social_media.youtube.base import YouTubeEngine
y = YouTubeEngine() # init the engine object
y.login() # login to youtube account, needed if you want to add the playlist to your library
first_result = y.get_playlists('Mind Field') # search for playlist and get the first result
# first_result[0].add_playlist() optional step, if you want to add the playlist to your library
first_result[0].populate() # load video objects for all the contents of the playlist (can be skipped)
first_result[0].download() # download all videos in the playlist (internally populates the playlist if it is not populated)
y.logout() # logout from your youtube account
y.close()

About

A library for automating several social media actions, such as posting, login, notifications etc. for multiple social media sites and an API free, purely selenium based solution for scraping data without using any APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published