<?xml version="1.0" encoding="utf-8"?>
        <?xml-stylesheet type="text/css" href="http://www.linuxevolution.org/styles/feed.css"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>Filed under: Twitter | Linux Evolution dot org and the NSLU2</title>
<atom:link href="http://linuxevolution.org/archives/twitter/index-rss.xml" rel="self" type="application/rss+xml" />
<link>http://linuxevolution.org</link>
<description></description>
<dc:language>en-us</dc:language>
<dc:creator>orvtech</dc:creator>
<dc:date>2010-12-26T18:58:30-05:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://linuxevolution.org/archives/2010/03/14/the_end_of_public_access_to_my_nslu2/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/03/14/the_end_of_public_access_to_my_nslu2/index.html</guid>
<title>The end of public access to my NSLU2? </title>
<dc:date>2010-03-14T20:01:57-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> NSLU2, Twitter</dc:subject>
<description><![CDATA[<p>
I just found out that the 'datacenter' where I have my NSLU2 will be shooting down soon. When I say datacenter I mean the house of a friend that have a public IP, this will happen within the next 2 months so I need to start thinking on what to do to keep this site alive and maintained by a NSLU2. 
<br />
<br />
<img src="http://www.linuxevolution.org/images/jailed_nslu2.png" align=left> Right now I thing the best option is just to bring it to my house and use it as a backend or publisher and use the VPS as my frontend. I am still contemplating other ideas but I think the easiest option is to just publish trough my NSLU2 and  rsync the content to my VPS. My home ISP is u-verse and I dont know how friendly are they about hosting services. 
</p>
<p>
If you have any suggestion please dont hesitate to let me know via twitter ( <a href="http://twitter.com/m1n1m3">@m1n1m1</a> ) or just leave  a comment... also if you are hosting any kind of service via u-verse please let me know how has been your experience. 
</p>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/nslu2/ha-llegado-el-fin-del-acceso-publico-a-mi-nslu2/" rel="friend" hreflang="es">Ha llegado el fin del acceso publico a mi NSLU2.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2009/11/30/the_nslu2_as_a_last_fm_to_twitter_bridge/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2009/11/30/the_nslu2_as_a_last_fm_to_twitter_bridge/index.html</guid>
<title>The NSLU2 as a last.fm to twitter bridge.</title>
<dc:date>2009-11-30T16:57:10-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, Last_FM, NSLU2, Linux, Twitter</dc:subject>
<description><![CDATA[<p>This simple script came from the need of updating <a href="http://twitter.com/m1n1m3">my twitter</a> 
status with the songs that I am playing, the trick is that it will only update my profile 
if the song has been tagged as 'loved' on last.fm. It will also detect if it is Monday 
and will add the <a href="http://twitter.com/#search?q=%23mm"><i>#mm</i> hash</a>.</p>

<textarea class="bashcode" readonly wrap="off">twitter_user="<your_twitter_user_here>"
twitter_passwd="your_twitter_password_here"
URL="http://twitter.com/statuses/update.xml"
tags="#lastfm"
lastfm_api="<your_api_from_lastfm_here>"
lastfm_user="<your_lastfm_user_here>"
bit_ly_user="<your_bit.ly_user_here>"
bit_ly_apikey="<your_bit.ly_api_key_here>"

fmtwitted=`cat /tmp/lastfm2twitter.tmp | \
sed -e 's/status=Just played: //g' -e 's/#.*//g' | \
grep '[a-z]'|sed -e 's/\ //g' -e 's/\-/./g'`

fmcurrent=`curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" | \
grep -E '<name>|</name>|<artist\ |</artist>' |\
head -n2| sed -e 's/<[^>]*>//g' | tr '\n' '.' |\
sed -e 's/\ //g' -e 's/.$//g'`


lastfm_song_url=`curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" |\
grep -E '<url>|</url>' | sed -e 's/<[^>]*>//g' |\
head -n1| tr '\n' '.' | sed -e 's/\ //g' -e 's/.$//g'`
bit_ly_url=`curl -s "http://api.bit.ly/shorten?version=2.0.1&longUrl=$lastfm_song_url&login=$bit_ly_user&apiKey=$bit_ly_apikey" | \
grep shortUrl | sed -e 's/\"/\ /g' | awk '{print $3}'`

today_mm=`date +%A`
if [[ $today_mm == "Monday"  ]] 
  then tags="$tags #mm"
fi


if grep $fmcurrent /tmp/lastfm_loved.tmp  > /dev/null
  then if [[ "$fmtwitted" == "$fmcurrent" ]]
      then exit 0
        else curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" | \
	grep -E '<name>|</name>|<artist\ |</artist>' |\
	head -n2| sed -e 's/<[^>]*>//g' | tr '\n' '-' | \
	sed -e 's/^[ \t]*//' -e 's/-/\ -\ /g' -e 's/- $//g' -e 's/\ $//g' |\
	awk '{print "status=Just played: "$0}' > /tmp/lastfm2twitter.tmp
	lastfm2twitter=`cat /tmp/lastfm2twitter.tmp; 
	echo $bit_ly_url 
	echo $tags | tr '\n' ' '`
	echo $lastfm2twitter > /tmp/lastfm2twitter.tmp
	curl -s -u $twitter_user:$twitter_passwd -d @/tmp/lastfm2twitter.tmp $URL > /dev/null
	  fi
	  else exit 0
fi</textarea>
<br />
<p>As you can see I am using bit.ly to shorten the urls of the song, you will need a bit.ly API for this to work. 
I think what is left is to optimize the script storing the curl requests in a file sort of like a cache 
and add a routine to detect if it is longer than the 140 charaters allowed by twitte and shorten the text 
to be posted as the status.r</p> 
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/el-nslu2-como-un-puente-de-last-fm-a-twitter/" rel="friend" hreflang="es">El NSLU2 como un puente de last.fm a twitter.</a>
</i></p>]]></description>

</item>
</channel>
</rss>

