Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Brabantis

macrumors newbie
Original poster
Mar 11, 2013
1
0
Hi everybody,
I am using GeekTool to make me a steampunk desktop, and this is what I got so far:
screenshot.png

I have yet to position properly the calendar and add a weather forecast, but my point is, I am trying to put the RSS feed on the cream-coloured page. I managed to export it into an image (using ImageMagick) and paste that image, however, since there is no set carriage return, if I want to fit to the width of the page, the letters will be so tiny as to be unreadable. I wanted to know if it was possible to twitch the script so that it would make automatic carriage returns after a set width. And I tried checking the "force carriage return" box, it doesn't work.

The script I am using is
Code:
URL="http://feeds.bbci.co.uk/news/rss.xml"
maxLength="400"
start="3"
end="7"

curl --silent "$URL" |
sed -e :a -e '$!N;s/\n//;ta' |
sed -e 's/<title>/\
<title>/g' |
sed -e 's/<\/title>/<\/title>\
/g' |
sed -e 's/<description>/\
<description>/g' |
sed -e 's/<\/description>/<\/description>\
/g' |
grep -E '(title>|description>)' |
sed -n "$start,$"'p' |
sed -e 's/<title>//' |
sed -e 's/<\/title>//' |
sed -e 's/<description>/   /' |
sed -e 's/<\/description>//' |
sed -e 's/<!\[CDATA\[//g' |
sed -e 's/\]\]>//g' |
sed -e 's/</</g' |
sed -e 's/>/>/g' |
sed -e 's/<[^>]*>//g' |
cut -c 1-$maxLength |
head -$end |
sed G |
fmt| /opt/local/bin/convert -rotate 15 -background none -fill black -font Courier label:@- -trim /tmp/label.png

The ImageMagick part works great even though the syntax looks bad, but I don't want to delve into mysteries.

Thank you!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.