Revision [779]

Last edited on 2016-04-27 10:47:36 by CyberKiller [change in flattr buttons]
Additions:
If you liked this howto please consider flattring: (button on top of the page)
Deletions:
If you liked this howto please consider flattring: """"


Revision [778]

Edited on 2016-04-27 10:47:06 by CyberKiller [flattr change]
Additions:
If you liked this howto please consider flattring: """"
Deletions:
If you liked this howto please consider flattring: ""

""


Revision [694]

Edited on 2011-09-06 09:38:56 by CyberKiller [another bugfix ;-)]
Additions:
grep --line-buffered -v -P -e '^\S+:\s@\S+.+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep --line-buffered -v -P -e '^\S+:\s@\S+.+' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &
Deletions:
grep --line-buffered -v -E '^\S+:\s@\S+.+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep --line-buffered -v -E '^\S+:\s@\S+.+' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [693]

Edited on 2011-09-06 09:07:18 by CyberKiller [bugfix for filtering]
Additions:
grep --line-buffered -v -E '^\S+:\s@\S+.+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep --line-buffered -v -E '^\S+:\s@\S+.+' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &
Deletions:
grep -v -E '^\S+:\s@\S+.+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+.+' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [692]

Edited on 2011-09-06 05:14:08 by CyberKiller [bugfix ;-)]
Additions:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &
I recommend you check the relevant manpages on what these all parameters mean. This single line will post the titles from a single rss feed to a single xmpp chatroom. It will run in the background, to turn it off you need to kill the rsstail process, the rest will terminate automatically.
(tail -f /tmp/mychatroom-stream & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+.+' | sendxmpp -u -j -p -r --message-type=chat -t -i -c "" 2>&1 &
Deletions:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
I recommend you check the relevant manpages on what these all parameters mean. This single line will post the titles from a single rss feed to a single xmpp chatroom. It will run in background, to turn it off you need to kill the rsstail process, the rest will terminate automatically.
(tail -f /tmp/mychatroom-stream & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+.+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [691]

Edited on 2011-09-06 04:46:15 by CyberKiller [last correction in grep regexp]
Additions:
grep -v -E '^\S+:\s@\S+.+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+.+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
Deletions:
grep -v -E '^\S+:\s@\S+'
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [690]

Edited on 2011-09-06 04:44:38 by CyberKiller [small correction in grep regexp]
Additions:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '^\S+:\s@\S+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
Deletions:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '\S+:\s@\S+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [689]

Edited on 2011-09-06 04:44:16 by CyberKiller [small correction in regexp]
Additions:
grep -v -E '^\S+:\s@\S+'
Deletions:
grep -v -E '\S+:\s@\S+'


Revision [688]

Edited on 2011-09-06 04:39:27 by CyberKiller [how to filter out @replies from identica]
Additions:
~- tail - for sending multiple feeds to 1 chatroom
~- grep - for filtering
====Filtering out some lines====
I'm using this script to send my identi.ca stream to a chatroom and some people said that @replies are out of context and unnecessary, so I figured out a small addition to filter them out:
grep -v -E '\S+:\s@\S+'
should be added as another pipe after sed, so the "bot-string" becomes:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | grep -v -E '\S+:\s@\S+' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &


Revision [687]

Edited on 2011-09-05 04:29:48 by CyberKiller [stability fixes]
Additions:
rsstail -n 0 -i 120 -z -P -u | sed -ue 's/Title: //g' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
(rsstail -n 0 -i 120 -z -P -u & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sed -ue 's/Title: //g' >> /tmp/mychatroom-stream 2>&1 &
(rsstail -n 0 -i 120 -z -P -u & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sed -ue 's/Title: //g' >> /tmp/mychatroom-stream 2>&1 &
Deletions:
rsstail -n 0 -i 120 -u | sed -ue 's/Title: //g' | sendxmpp -ue -j -p -r --message-type=chat -t -i -c "" 2>&1 &
(rsstail -n 0 -i 120 -u & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sed -ue 's/Title: //g' >> /tmp/mychatroom-stream 2>&1 &
(rsstail -n 0 -i 120 -u & echo $! >&3 ) 3>>/tmp/rss2xmpp-bot.pids | sed -ue 's/Title: //g' >> /tmp/mychatroom-stream 2>&1 &


Revision [686]

Edited on 2011-09-02 14:04:37 by CyberKiller [minor corrections]
Additions:
##Sed## is usually installed by default, ##rsstail## and ##sendxmpp## are usually found in the distros repository. Obviously you'll need a text editor of some sort. The xmpp account will be used by the bot, I recommend to create a new account for this, do not use your own.
Now here comes the tricky part... How to send multiple rss feeds to a single chatroom. You could just copy the line for each feed (remember to keep the unique), but this would keep multiple bots in the chatroom all the time and it wouldn't look too nice. Here is what I've come up with:
Deletions:
##Sed## is usually installed by default, ##rsstail## and ##sendxmpp## are usually found in the distros repository. Obviously you'll need a text editor of some sort. The xmpp account will be used by the bot, I recommend to create a new account for this not, use your own.
Now here comes the tricky part... How to send multiple rss feeds to a single chatroom. You could just copy the line for each feed (remember to keep the unique), but this would keep multiple bots in the chatroom all the time and it wouldn't look too nice. Here is what I've come up:


Revision [685]

Edited on 2011-09-02 14:01:51 by CyberKiller [typo]
Additions:
~- rsstail - to read the feed, works great for identi.ca
This is it! ;-) It works rather stably, although some lag is known to exist (especially visible if you use a rss feed from some microblogging service like identi.ca).
Deletions:
~- rsstail - to read the stream, works great for identi.ca
This is it! ;-) It works rather stablily, although some lag is known to exist (especially visible if you use a rss feed from some microblogging service like identi.ca).


Revision [683]

Edited on 2011-09-02 09:46:49 by CyberKiller [one more note]
Additions:
One more note: if you are using the variant with the temp file for multiple feeds, it's a good idea to kill the bot and start it over once in a while to purge the temporary file.


Revision [682]

The oldest known version of this page was created on 2011-09-02 09:45:12 by CyberKiller [first version]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki