Skip to content Gå til innhold


How to post to Twitter from the Linux command line Hvordan legge til Twitter fra Linux kommandolinjen

Linux

Twitter has become a big part the online lives of a lot of people in the recent months. Twitter har blitt en stor del den elektroniske livet til mange mennesker i de siste månedene. Although in itself Twitter is a pretty simple service, which makes it easy for just about everyone to use it, it ships with an API which has helped people port it to just about every platform. Selv i seg selv Twitter er en ganske enkel tjeneste som gjør det enkelt for nesten alle til å bruke det, leveres den med en API som har hjulpet folk port den til omtrent alle plattformer. Twitter has been ported to web browsers, to cellphones, and apparently even Twitter har blitt oversatt til nettlesere, for mobiltelefoner, og tilsynelatende også washing machines vaskemaskiner haven't been spared. har ikke vært spart. The Linux command line has always been a favorite of geeks. Linux kommandolinje har alltid vært en favoritt for geeks. Here's a trick that's great fun, and could be useful if required. Her er et triks som er veldig moro, og kunne være nyttig hvis nødvendig.

Let's see how to post an update to your Twitter account right from the Linux command line. La oss se hvordan å legge inn en oppdatering til din Twitter-konto rett fra Linux kommandolinjen. This will also work on the MacOS X command line. Dette vil også arbeide på MacOS X kommandolinjen. Enter the following command in your terminal interface, replacing username and password with your Twitter account credentials, and status="Tweeting from the Linux command line" with your own message. Skriv inn følgende kommando i Terminal-grensesnitt, og erstatte brukernavn og passord med din Twitter-konto legitimasjon, og status = "Tweeting fra Linux kommandolinjen" med din egen melding.

# curl -u username:password -d status="Tweeting from the Linux command line" http://twitter.com/statuses/update.xml > /dev/null # Curl-u brukernavn: passord-D-status = "Tweeting fra Linux kommandolinjen" http://twitter.com/statuses/update.xml> / dev / null

So if your Twitter username is fuzzycat17 and you password is fur123ball the above command will look like this: Så hvis din Twitter-brukernavn er fuzzycat17 og du passordet er fur123ball ovenfor kommandoen vil se slik ut:

# curl -u fuzzycat17:fur123ball -d status="Tweeting from the Linux command line" http://twitter.com/statuses/update.xml > /dev/null # Curl-u fuzzycat17: fur123ball-D-status = "Tweeting fra Linux kommandolinjen" http://twitter.com/statuses/update.xml> / dev / null

Running this command will result in a new Tweet being posted from your account containing the words Tweeting from the Linux command line Kjører denne kommandoen vil resultere i en ny Tweet blir lagt ut fra kontoen din inneholder ordene Tweeting fra Linux kommandolinjen

Now go check your Twitter home page to see if the Tweet was posted correctly. Nå går sjekke din Twitter-hjemmeside for å se om Tweet ble gjort riktig.

As I said, this trick could be completely for geekish fun, or could be put to good use. Som jeg sa, kan dette trikset være helt for geekish moro, eller kan komme til praktisk bruk. You could integrate this command into shell script to notify you of something. Du kunne integrere denne kommandoen til shell script for å varsle deg om noe.

Happy Tweeting. Happy Tweeting.

Posted in Posted in Linux Linux . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! Få Enkelt Hjelp opplæring akkurat som dette i innboksen hver dag - helt gratis! Just enter your email address below: Bare skriv inn din e-postadresse nedenfor:

You can always opt out of this email subscription at any time. Du kan alltid velge bort denne e-abonnementet når som helst.

3 Responses 3 Svar

Stay in touch with the conversation, subscribe to the Hold kontakten med samtalen, abonnere på RSS feed for comments on this post RSS feed for kommentarer til dette innlegget . .

  1. wock says wock sier

    Its cool tips, thx. Dens avkjøle tips, thx. How to make a script that implements these steps? Hvordan lage et skript som implementerer disse trinnene?

  2. Jon Payne Jon Payne says sier

    Can I assume that aa direct message or @ reply would simply be added to the sent string? Kan jeg anta at aa direkte melding eller @ svar ville bare bli lagt til den sendte strengen? For example curl -u fuzzycat17:fur123ball -d status=”@somename Tweeting from the Linux command line” For eksempel curl-u fuzzycat17: fur123ball-D-status = "@ somename Tweeting fra Linux kommandolinjen" http://twitter.com/statuses/update.xml http://twitter.com/statuses/update.xml > /dev/null; or status=”d somename . > / Dev / null; eller status = "d somename. . . . . "

    True? Sant?

Continuing the Discussion Fortsetter Discussion

  1. Tweet from the command line « Linux & Stuff Tweet fra kommandolinjen «Linux & Stuff linked to this post on May 6, 2009 knyttet til dette innlegget den 6 mai 2009

    [...] in CLI, twitter Nice little trick from Simple Help. [...] I CLI, kvitter Nice little trick fra enkle Hjelp. I tried this and it works perfectly. Jeg prøvde dette og det fungerer perfekt. Only problem is there's nothing to tell you you gone [...] Eneste problemet er der ikke er noe å fortelle deg borte [...]



Some HTML is OK Some HTML is OK

or, reply to this post via eller svare på dette innlegget via trackback styrekule . .