<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
	<title>Хабрахабр / Комментарии к посту «Bash и Twitter» в блоге «Linux для всех»</title>
	<link>http://habrahabr.ru/rss/post/50235/</link>
	<description><![CDATA[Новые комментарии к посту «Bash и Twitter» в блоге «Linux для всех»]]></description>
	<language>ru</language>
	<managingEditor>editor@habrahabr.ru</managingEditor>
	<generator>habrahabr.ru</generator>
	<pubDate>Sat, 11 Feb 2012 09:31:33 GMT</pubDate>
	<lastBuildDate></lastBuildDate>
	<image>
		<link>http://habrahabr.ru/</link>
		<url>http://habrahabr.ru/i/logo.gif</url>
		<title>Хабрахабр</title>
	</image>
	

	
	
	
	
	
		
	
		<item>
			<title>28.02.2010 00:44:17 ibex</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_2563769</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_2563769</link>
			<description><![CDATA[Люди добрые, объясните, почему строчка<br/>
curl --basic --user twitteruser:123456789 \ --data status=«test post» 'http://twitter.com/statuses/update.xml' -o /dev/null;<br/>
мгновенно отправляет пост в твиттер а вышеприведенный скрипт с учтённой правкой выделывается.<br/>
<br/>
# ./tw.sh test post<br/>
<blockquote>curl: (6) Couldn't resolve host ' --data'<br/>
curl: (6) Couldn't resolve host 'status=test'<br/>
&lt;?xml version=«1.0» encoding=«UTF-8»?&gt;<br/>
 /statuses/update.xml<br/>
 This method requires a POST.<br/>
<br/>
</blockquote><br/>
еще и думает около минуты…<br/>
<br/>
]]></description>
			<pubDate>Sun, 28 Feb 2010 00:44:17 GMT</pubDate>
			<author>ibex</author>
		</item>
	

	
		<item>
			<title>29.01.2009 19:26:08 Takeji</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1331365</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1331365</link>
			<description><![CDATA[Небольшая поправочка:<br/>
<code>MSGLEN=`echo $MSG | wc -c`</code>]]></description>
			<pubDate>Thu, 29 Jan 2009 19:26:08 GMT</pubDate>
			<author>Takeji</author>
		</item>
	

	
		<item>
			<title>28.01.2009 21:30:01 7hr33pw1r3</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1328300</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1328300</link>
			<description><![CDATA[Лучше сделать вот так, тогда скрипт для всех подойдет и не надо каждый раз набирать логин/пасс<br/>
<blockquote>#!/bin/bash<br/>
<br/>
FILE=&quot;$HOME/.twitter&quot;<br/>
<br/>
if [! -f $FILE ]; then<br/>
echo &quot;$FILE: does not exists.&quot;<br/>
echo «Please create this file with following contents:»<br/>
echo &quot;[login]&quot;<br/>
echo &quot;[pass]&quot;<br/>
echo «Where [login] and [pass] is your twitter login/password.»<br/>
echo «Make sure you DO NOT have an empty line in the end of file and/or spaces at start/end of the lines or authentication may fail.»<br/>
exit 1<br/>
elif [! -r $FILE ]; then<br/>
echo &quot;$FILE: can not be read&quot;<br/>
exit 2<br/>
fi<br/>
<br/>
if [ `stat -c %a $FILE` -ne 600 ]; then <br/>
echo «WARNING: file chmod is not safe! Will try to fix.»<br/>
exec chmod 0600 $FILE<br/>
fi<br/>
<br/>
LOGIN=`head -n 1 $FILE` # quick'n'dirty =)<br/>
PASSWORD=`tail -n 1 $FILE`<br/>
<br/>
MSG=&quot;$*&quot;<br/>
<br/>
MSGLEN=`echo $3 | wc -c`<br/>
if [ $MSGLEN -gt 140 ]; then<br/>
echo «Too much text»<br/>
exit 3<br/>
fi<br/>
<br/>
curl --basic --user $LOGIN:$PASSWORD \<br/>
--data status=$MSG 'http://twitter.com/statuses/update.xml' -o /dev/null;<br/>
</blockquote>]]></description>
			<pubDate>Wed, 28 Jan 2009 21:30:01 GMT</pubDate>
			<author>7hr33pw1r3</author>
		</item>
	

	
		<item>
			<title>28.01.2009 10:30:32 Takeji</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1326311</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1326311</link>
			<description><![CDATA[А можно сделать так:<br/>
<br/>
<code>#!/bin/bash<br/>
len=`echo $3 | wc -c`<br/>
if [ $len -gt 140 ]; then<br/>
echo &quot;Too much&quot;<br/>
exit 1<br/>
fi<br/>
<br/>
curl --basic --user $1:$2 \<br/>
--data status=$3 'http://twitter.com/statuses/update.xml' -o /dev/null;</code><br/>
<br/>
Кидаем скрипт куда-нибудь в /usr/local/bin и запускаем вот так:<br/>
<br/>
<code>$ tw user pass 'Тест'</code>]]></description>
			<pubDate>Wed, 28 Jan 2009 10:30:32 GMT</pubDate>
			<author>Takeji</author>
		</item>
	

	
		<item>
			<title>26.01.2009 23:50:59 enchantner</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1321244</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1321244</link>
			<description><![CDATA[в данном случае этот способ не подходит]]></description>
			<pubDate>Mon, 26 Jan 2009 23:50:59 GMT</pubDate>
			<author>enchantner</author>
		</item>
	

	
		<item>
			<title>26.01.2009 21:47:36 etz</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1321017</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1321017</link>
			<description><![CDATA[экранируйте его слэшем — вот так\!]]></description>
			<pubDate>Mon, 26 Jan 2009 21:47:36 GMT</pubDate>
			<author>etz</author>
		</item>
	

	
		<item>
			<title>26.01.2009 17:41:26 enchantner</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1320422</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1320422</link>
			<description><![CDATA[Или временно выключить histexpand командой set +H]]></description>
			<pubDate>Mon, 26 Jan 2009 17:41:26 GMT</pubDate>
			<author>enchantner</author>
		</item>
	

	
		<item>
			<title>26.01.2009 17:38:32 enchantner</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1320414</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1320414</link>
			<description><![CDATA[Лучше использовать одинарные кавычки вместо двойных.]]></description>
			<pubDate>Mon, 26 Jan 2009 17:38:32 GMT</pubDate>
			<author>enchantner</author>
		</item>
	

	
		<item>
			<title>26.01.2009 17:35:09 enchantner</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1320407</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1320407</link>
			<description><![CDATA[У меня и с русским все работает нормально, локаль UTF-8, Ubuntu 8.10.]]></description>
			<pubDate>Mon, 26 Jan 2009 17:35:09 GMT</pubDate>
			<author>enchantner</author>
		</item>
	

	
		<item>
			<title>26.01.2009 16:48:00 gramilla</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1320281</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1320281</link>
			<description><![CDATA[Есть одна проблема в скрипте, при добавлении записи у которой в конце восклицательный знак, скрипт не хочет работать]]></description>
			<pubDate>Mon, 26 Jan 2009 16:48:00 GMT</pubDate>
			<author>gramilla</author>
		</item>
	

	
		<item>
			<title>26.01.2009 11:31:50 laQie</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1319068</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1319068</link>
			<description><![CDATA[А какая кодировка должна быть при отправке? Если системная локаль UTF-8 — русские буквы не отображаются нормально.]]></description>
			<pubDate>Mon, 26 Jan 2009 11:31:50 GMT</pubDate>
			<author>laQie</author>
		</item>
	

	
		<item>
			<title>26.01.2009 10:37:51 fhh</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318948</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318948</link>
			<description><![CDATA[Или так<br/>
<br/>
len=`echo &quot;$*&quot; | wc -c`<br/>
<br/>
if [ $len -gt 140 ]; then<br/>
s=«Too much»<br/>
`notify-send «Twitter» &quot;$s&quot;`<br/>
exit 1<br/>
fi]]></description>
			<pubDate>Mon, 26 Jan 2009 10:37:51 GMT</pubDate>
			<author>fhh</author>
		</item>
	

	
		<item>
			<title>26.01.2009 08:40:10 drew</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318657</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318657</link>
			<description><![CDATA[В <abbr>API</abbr> к Twitter есть некоторые команды с curl: <a href="http://apiwiki.twitter.com/REST+API+Documentation">apiwiki.twitter.com/REST+API+Documentation</a>]]></description>
			<pubDate>Mon, 26 Jan 2009 08:40:10 GMT</pubDate>
			<author>drew</author>
		</item>
	

	
		<item>
			<title>26.01.2009 08:31:00 k0sh</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318641</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318641</link>
			<description><![CDATA[Добавляем проверку на 140 символов:<br/>
<blockquote><pre>
len=`echo &quot;$*&quot; | wc -c`
if [ $len -gt  140 ]; then
        echo &quot;Too much&quot;
        exit 1
fi
</pre></blockquote><br/>
]]></description>
			<pubDate>Mon, 26 Jan 2009 08:31:00 GMT</pubDate>
			<author>k0sh</author>
		</item>
	

	
		<item>
			<title>26.01.2009 08:09:44 vini</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318594</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318594</link>
			<description><![CDATA[прикольна))]]></description>
			<pubDate>Mon, 26 Jan 2009 08:09:44 GMT</pubDate>
			<author>vini</author>
		</item>
	

	
		<item>
			<title>26.01.2009 05:58:24 iv1</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318397</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318397</link>
			<description><![CDATA[Вот к Хабру прикрутить такое: постить и получать фидбэк.]]></description>
			<pubDate>Mon, 26 Jan 2009 05:58:24 GMT</pubDate>
			<author>iv1</author>
		</item>
	

	
		<item>
			<title>26.01.2009 05:38:19 dimaka</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318380</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318380</link>
			<description><![CDATA[А я иногда пишу в тви из vim, с помощью плагина twitvim. Там же можно просматривать и таймлайн, и реплаи, постить строку из буффера или весь буффер полностью.]]></description>
			<pubDate>Mon, 26 Jan 2009 05:38:19 GMT</pubDate>
			<author>dimaka</author>
		</item>
	

	
		<item>
			<title>26.01.2009 05:23:18 sharkman</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318366</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318366</link>
			<description><![CDATA[Я-бы не советовал класть сей скрипт в /usr/local/bin, если в системе несколько пользователей, лучше положить куда-нибудь в ~/bin, ведь в скрипте указаны логин и пароль… да, и ещё права выставить лучше 700]]></description>
			<pubDate>Mon, 26 Jan 2009 05:23:18 GMT</pubDate>
			<author>sharkman</author>
		</item>
	

	
		<item>
			<title>26.01.2009 04:52:46 Marsikus</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318346</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318346</link>
			<description><![CDATA[Изящно! ]]></description>
			<pubDate>Mon, 26 Jan 2009 04:52:46 GMT</pubDate>
			<author>Marsikus</author>
		</item>
	

	
		<item>
			<title>26.01.2009 03:33:56 svartalf</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318313</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318313</link>
			<description><![CDATA[<a href="http://www.ibm.com/developerworks/linux/library/l-friendfeed/">Update Twitter and FriendFeed from the Linux command line</a>]]></description>
			<pubDate>Mon, 26 Jan 2009 03:33:56 GMT</pubDate>
			<author>svartalf</author>
		</item>
	

	
		<item>
			<title>26.01.2009 03:26:48 Lashezzz</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318311</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318311</link>
			<description><![CDATA[CURL — это сила!!! спасибо за пост!)]]></description>
			<pubDate>Mon, 26 Jan 2009 03:26:48 GMT</pubDate>
			<author>Lashezzz</author>
		</item>
	

	
		<item>
			<title>26.01.2009 03:13:09 iv1</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318303</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318303</link>
			<description><![CDATA[очень странно парсер ссылки отобразил.]]></description>
			<pubDate>Mon, 26 Jan 2009 03:13:09 GMT</pubDate>
			<author>iv1</author>
		</item>
	

	
		<item>
			<title>26.01.2009 03:07:47 iv1</title>
			<guid isPermaLink="true">http://habrahabr.ru/blogs/linux/50235/#comment_1318300</guid>
			<link>http://habrahabr.ru/blogs/linux/50235/#comment_1318300</link>
			<description><![CDATA[Автор молодец, а для интересующихся like me подробности о команде curl ( rus-linux.net/MyLDP/internet/curlrus.html )<br/>
rus-linux.net/MyLDP/internet/curlrus.html]]></description>
			<pubDate>Mon, 26 Jan 2009 03:07:47 GMT</pubDate>
			<author>iv1</author>
		</item>
	

	
</channel>
</rss>

