Git Product home page Git Product logo

twickster's Introduction

Unofficial Python Twitter API.

Why twickster ?

I used the official Twitter API frequently before Elon barricaded the basic access, now we have to pay a shit load of benjamens to hook up the access. So I decided to make something else that still makes the API accessing to me, hence twickster (twitter+trickster morphword). So if you dont have enough money to use the official twitter API, then this is for you.

Installation

You need to have twickster installed on your machine to start using it which can either be done directly from GitHub or using pip.

Installing directly

You first need to clone or download the repo to your local directory and then move into the project directory as shown in the example and then run the command below;

git clone https://github.com/mokoshalb/twickster
cd twickster
twickster > python setup.py install 
....

Installing from pip

pip install twickster --upgrade

How to use twickster?

from twickster import API

if __name__ == '__main__':
    try:
        api = API()
        api.log('Starting Twitter API Engine')
        api.login() #login

        tweetid = api.getTweetID("https://twitter.com/user/status/1702750653842371060") #accept twitter url as string, returns id of tweet

        tweet = api.readTweet(tweetid) #read tweet, accept tweet id as string, returns object of tweet

        media = [] #initialize media
        medium = api.createMedia("temp.mp4", "tweet_video") #create twitter media, accept 2 parameters, file name path and file type tweet_image for picture and tweet_video for videos
        media.append(medium) #store media in array

        api.createTweet("i love it here!", media=media) #create tweet, accept up to 4 parameters, tweet text, in_reply_to_tweet_id if it is a reply, media array of media ids if it contains a media, attachment_url id of a tweet to quote in tweet
        api.deleteTweet(tweetid) #delete tweet, accept tweet id as string

        api.likeTweet(tweetid) #like tweet, accept tweet id as string
        api.unlikeTweet(tweetid) #unlike tweet, accept tweet id as string

        api.createRetweet(tweetid) #retweet tweet, accept tweet id as string
        api.deleteRetweet(tweetid) #delete retweet tweet, accept tweet id as string

        api.pinTweet(tweetid) #pin tweet to profile, accept tweet id as string
        api.unpinTweet(tweetid) #unpin tweet to profile, accept tweet id as string

        api.createBookmark(tweetid) #add tweet to bookmark, accept tweet id as string
        api.deleteBookmark(tweetid) #remove tweet from bookmark, accept tweet id as string

        api.follow("1324833791974744064") #follow a user, accept user id as string
        api.unfollow("1324833791974744064") #unfollow a user, accept user id as string

    except Exception as error:
        print("Error", error)

Well! thats all for now from the package, to request new feature make an issue.

Contributions

twickster is an open-source package, so contributions are warmly welcome.

When contributing to code please make an issue for that before making your changes so that we can have a discussion before implementation.

Issues

If you're facing any issue or difficulty with the usage of the package just raise one so that we can fix it as soon as possible.

Please, be as much comprehensive as possible! Use as many screenshots and detailed description sets as possible; this will save us some time that we'd dedicate on asking you for "a more detailed descriptiton", and it'll make your request be solved faster.

Give it a star

Was this useful to you ? Then give it a star so that more people can manke use of this.

twickster's People

Contributors

mokoshalb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.