✨🐥 InstaTweet 🐤✨¶
Automatically Repost Content From Instagram to Twitter¶
Ever tried sharing an Instagram post to Twitter, only to find out that all you tweeted was a link, and not the actual photo/video?
Humiliating 🤮
That could be literally anything. Nobody will click it.
InstaTweet
shares the actual content of the post. Not just a link to it.
With InstaTweet
, you can rest easy knowing that,
although nobody will click the link, they’ll at least see what you posted.
What’s InstaTweet?¶
InstaTweet
is a customizable tool to automatically repost content from Instagram to Twitter.
Simply create a Profile
,
configure the Mandatory Settings,
and add_users()
to repost from
from InstaTweet import Profile
# Create a new (local) Profile
>>> profile = Profile('myProfile')
# Configure the required settings (at minimum)
>>> profile.twitter_keys = twitter_api_keys
>>> profile.session_id = '6011991A'
# Add at least one Instagram account to repost from
>>> profile.add_users('the.dailykitten')
Once configured, the Profile
can be used to initialize and
start()
an InstaTweet
object
from InstaTweet import InstaTweet
# Directly initialize with the Profile from above
>>> insta_tweet = InstaTweet(profile)
# Or, save the Profile...
>>> profile.save()
Saved Local Profile myProfile
# ...then InstaTweet.load() the settings in (by Profile name)
>>> insta_tweet = InstaTweet.load(profile_name="myProfile")
# Run InstaTweet by calling start()
>>> insta_tweet.start()
From the Docs…
- InstaTweet.start()[source]View on GitHub
InstaTweets all users that have been added to the loaded
Profile
Each user’s IG page will be scraped and compared to the
scraped
list in theirUSER_MAPPING
. Posts that weren’t previously scraped will be downloaded and tweetedNote
If
InstaTweet
fails todownload_post()
orsend_tweet()
, theUSER_MAPPING
won’t be updatedThis ensures that failed repost attempts are retried in the next call to
start()
If a save file for the Profile already
exists
, successful reposts will trigger a call tosave()
As InstaTweet
runs, its progress will be logged to console:
Starting InstaTweet for Profile: myProfile
Checking posts from @the.dailykitten
...
Finished insta-tweeting for @the.dailykitten
All users have been insta-tweeted
Okay… But Why? 😟¶
But Why? 🤨
InstaTweet has two main use cases:
To automatically share your own Instagram posts to Twitter
To automatically tweet new content from other Instagram users
Regardless of your intention, InstaTweet will detect new posts from the users you specify, download them, and repost them to Twitter.
Documentation¶
The rest of this README, the API documentation, and snippets can all be found on Read the Docs
I put a lot of time into creating the documentation for this package, it was a struggle, so it’d mean a lot to me if you could please continue reading there! 🥰
Installation¶
To install using pip:
pip install insta-tweet
Please note that InstaTweet
requires Python >= 3.8