Skip to content Перейти до змісту


How to post to Twitter from the Linux command line Як розмістити на Twitter з командного рядка Linux

Linux

Twitter has become a big part the online lives of a lot of people in the recent months. Twitter стала великою частиною онлайн життя багатьох людей в останні місяці. 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. Хоча сам по собі Twitter є досить простий сервіс, який робить її легкою для майже всіх його використовувати, вона поставляється з API яка допомогла людям порту воно практично на всі платформи. Twitter has been ported to web browsers, to cellphones, and apparently even Twitter працює на веб-браузери, із стільниковими телефонами, і, мабуть, навіть washing machines Пральні машини haven't been spared. не було в живих. The Linux command line has always been a favorite of geeks. Лінія Linux команди завжди був улюбленим вундеркіндів. Here's a trick that's great fun, and could be useful if required. Ось фокус, дуже весело, і може бути корисно у разі потреби.

Let's see how to post an update to your Twitter account right from the Linux command line. Давайте подивимося, як на пост оновити вашу увагу Twitter прямо з командного рядка Linux. This will also work on the MacOS X command line. Це також буде працювати в командному рядку, MacOS X. 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. Введіть таку команду в терміналі інтерфейс, замінивши ім'я користувача і пароль, з обліковими даними Twitter рахунок, а статус = "Tweeting від лінії команди Linux" на свої власні повідомлення.

# curl -u username:password -d status="Tweeting from the Linux command line" http://twitter.com/statuses/update.xml > /dev/null # Curl-U ім'я користувача: пароль-D Status = "Tweeting від лінії команди Linux" 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: Таким чином, якщо ваше ім'я користувача для Twitter fuzzycat17 і ви пароль fur123ball Ця команда буде виглядати наступним чином:

# 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 від лінії команди Linux" 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 Виконання цієї команди приведе до нових чірікать час Написав з облікового запису, що містять слова Tweeting з командного рядка Linux

Now go check your Twitter home page to see if the Tweet was posted correctly. Тепер йдемо перевірити ваш щебет головній сторінці, щоб переконатися, що чірікать стовп правильно.

As I said, this trick could be completely for geekish fun, or could be put to good use. Як я вже сказав, цей трюк можна було б повністю geekish для задоволення, чи можна було б з користю. You could integrate this command into shell script to notify you of something. Ви можете включити цю команду в скрипт, щоб проінформувати вас про щось.

Happy Tweeting. Happy Tweeting.

Posted in Опубліковано в Linux Linux . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! Отримати довідки Прості підручників, як це у вашому поштовому ящику щодня - безкоштовно! Just enter your email address below: Просто введіть свою адресу електронної пошти нижче:

You can always opt out of this email subscription at any time. Ви завжди можете відмовитися від підписки це повідомлення в будь-який час.

3 Responses 3 Відповіді

Stay in touch with the conversation, subscribe to the Залишайтеся на зв'язку при розмові, підпишіться на RSS feed for comments on this post RSS-канал для коментарів на цю посаду . .

  1. wock says wock говорить

    Its cool tips, thx. Його поради прохолодно, THX. How to make a script that implements these steps? Як зробити сценарій, який реалізує ці кроки?

  2. Jon Payne Джон Пейн says говорить

    Can I assume that aa direct message or @ reply would simply be added to the sent string? Чи можу я вважати, що А. А. прямого сполучення або @ відповідь буде просто додати до послав рядок? For example curl -u fuzzycat17:fur123ball -d status=”@somename Tweeting from the Linux command line” Наприклад Curl-U fuzzycat17: fur123ball-D Status = "@ SomeName Tweeting з командного рядка Linux" http://twitter.com/statuses/update.xml http://twitter.com/statuses/update.xml > /dev/null; or status=”d somename . > / Dev / NULL; або статус = "D SomeName. . . . . "

    True? Правда?

Continuing the Discussion Продовжуючи розмову

  1. Tweet from the command line « Linux & Stuff Чірікать з командного рядка «Linux & Stuff linked to this post on May 6, 2009 пов'язані з цієї посади по 6 травня 2009

    [...] in CLI, twitter Nice little trick from Simple Help. [...] У CLI, Twitter Nice маленька хитрість від простих Довідка. I tried this and it works perfectly. Я спробував це і це працює прекрасно. Only problem is there's nothing to tell you you gone [...] Єдина проблема полягає в нічого вам сказати ви пішли [...]



Some HTML is OK Деякі HTML нормально

or, reply to this post via або відповісти на цей пост через trackback Архів . .