sebagomez/shelltwit

By sebagomez

Updated over 3 years ago

shelltwit image for running in you own environment

Image
2

2.0K

sebagomez/shelltwit repository overview

shelltwit

Join the chat at https://gitter.im/sebagomez/shelltwit Travis Build Status Build Status

shelltwit updates your twitter status while at the command line. It also has bit.ly integration for url shortening. It's a good example of twitter API calls with xAuth. As of Jun-05-2017 it uses PIN-based authorization

shelltwit running on Windows

shelltwit running on Linux (WSL2)

Little more (?) info about it at the original blog post

Build

As of May 5th 2020 there's a single .NET Core 3.1 solution, which reference newly created NuGet packages. After downloading the repo just build the sln with Visual Studio 2019 (15.9+).

This build has been tested on Ubuntu WSL, and it works on my machine. It can now work on your machine thanks to Docker

For obvious security reasons I don't have the app Key and Secrets embeded in the code. If you want to run the app with your own crdentials you can setup two Environment variables named TWIT_KEY and TWIT_SECRET. With these, shelltwit will run as your registered twitter app.

You can also build the app with the provided build.cmd file if you're running on Windows or build.sh script if you're on Mac or Linux. If you're not on Windows you'll also need to run the publish.sh.

After that just open an terminal at the bin folder and run the application:

dotnet Sebagomez.Shelltwit.dll

Docker

In order to build your own container you must run the following command

docker run -e "TWIT_KEY=<Your Twitter Key>" -e "TWIT_SECRET=<Your Twitter Secret>" -it --name twit sebagomez/shelltwit 

Copy and paste the provided URL in your favorite browser, authorize the app to access twitter on your behalf and copy and paste the provided PIN in the command line waiting for it.

Now you have a container with the needed credentials to access the Twitter API.

We'll now commit those changes into a new image:

docker commit twit mytwit

And that's it, you can now call commands inside the newly created image as follows:

docker run --rm mytwit --help
🐤 Sebagomez.Shelltwit version 8.5.2.0 running on Microsoft Windows 10.0.19041
Copyright 2020 @SebaGomez

Usage: twit [options] | <status> [<mediaPath>]

Options:
        -c|--clear              clears user stored credentials
        -t|--timeline [count]   show user's timeline, optionally set how many twits to display (up to 200)
        -q|--query <query>      query twits containing words
        -m|--mentions           show user's mentions
        -u|--user <handle>      show another user's timeline
        -k|--track <track>      live status with a specific track
        -s|--streamed <handle>  streamed user timeline
        -s|--streamed <handle>  streamed user timeline
        -s|--streamed <handle>  streamed user timeline
        -l|--likes              user's likes (fka favorites)
        -h|--help               show this help

status:
        status to update at twitter.com

mediaPath:
        full path, between brackets, to the media files (up to four) to upload.

Tag summary

Content type

Image

Digest

sha256:cb7f4514d

Size

75.9 MB

Last updated

over 3 years ago

docker pull sebagomez/shelltwit