Table of Contents

Quick project: twitter api [python]

In this new post, I want to build myself a new component to be able to access/use my twitter accounts from python. I like twitter, it's handy to just quickly share a few words and then forget about it. But, I feel it's a bit of a pain for me to have to open my browser to send something there! 😝 So I would like to be able to use twitter easily directly from a command line! And given my recent journey in my NervProj framework, there is no better place to try to implement that from my perspective.

Setting up Twitter developper account and keys

Initial component skeleton

Adding support for authentication

I tried to look for another package that will support the API v2 in python but could not find anything so far.

Uploading a media file

Build an initial GUI application to handle the tweets

Add a Twitter panel to the NervGate app

While I was at it, I also added support to set icons on the “Send” button and for the application itself 😜

Handling the Send button action

The “+” in front of the “components” key here is just the mechanism I use to notify that the content of this dict, which is read from an additional “user config” file in my case, not just the NervProj “base config” file, should be appended/added to the existing dict instead of simply replacing it.

Conclusion

⇒ Okay, this is a pretty large article/dev session already, so i think I should stop it here for the moment. We will get back to this when I get an elevated twitte access to implement support to send images, etc. Meanwhile, Have a nice day everyone! 🖐