hi!
i'm trying to use sed for this, but i'm struggling a lot. i want to convert
<div class="middle" id="middle">Friday, 20 April 2012<br /> <span class="hex">728CB5</span> <br /></div>
into
fbsetroot -solid '#728CB5'
considering all information between 'id="middle">' and '<br /> <span' should be ignored or removed earlier (because it may vary), or only considering the information between '="hex">' and '</span>'
(that html line above were obtained from
wget http://www.chromatweet.com/index.html -O _.html && cat _.html | grep hex | grep middle
) (added some spaces on the url above because this forum is blocking urls in messages like this)
thanks in advance!
---------- Post updated at 12:15 PM ---------- Previous update was at 10:26 AM ----------
this code is working, but if you know some way to make it simpler, be welcome suggesting
wget http://www.chromatweet.com/index.html -O _.html
cat _.html | grep hex | grep middle | sed -n -e 's/.*hex\"\(.*\)\/span.*/\1/p' | sed -e 's/>/fbsetroot -solid \x27#/' | sed -e 's/</\x27/' > _.sh
chmod +x _.sh && bash _.sh && rm _.sh _.html