You are not logged in.

#1 2005-05-20 09:46:15

Vinny
Member
From: the fifth floor
Registered: 2005-04-25
Posts: 29

script to get new posts

This is a little time-saver script to find unread posts here and open each sub-forum in a tab.
Maybe someone will find it useful  :-)

newposts.sh:

#!/bin/sh
#BROWSER=mozilla  ## uncomment your preference
#BROWSER=firefox
SITE=bbs.archlinux.org
#PROFILEDIR=$HOME/.mozilla/default/________.slt  ## fill in teh blanks
#PROFILEDIR=$HOME/.mozilla/firefox/________.default
MSSG="data:,Checking%20for%20new%20posts.."

if ! $BROWSER -remote "ping()" 2>/dev/null ; then
    ( $BROWSER $MSSG &
    disown %1 )
    sleep 4
    else $BROWSER -remote "openURL ($MSSG,new-tab)"
fi

OVERWRITE_ME=1

a=$(wget --load-cookies $PROFILEDIR/cookies.txt 
 -O - $SITE 
 | grep -A 1 -e alt="New posts" 
 | grep -o -e '<a href=".*"' 
 | cut -d " -f 2 )

if [ -z "$a" ] ; then
  $BROWSER -remote "openURL (data:,No%20new%20posts%20in%20${SITE}.)"
  unset OVERWRITE_ME
  exit
else for b in $a
    do if [[ $OVERWRITE_ME = 1 ]]
        then $BROWSER -remote "openURL (http://$SITE/"$b")"
        unset OVERWRITE_ME
        else $BROWSER -remote "openURL (http://$SITE/"$b",new-tab)"
        fi
    done
fi

The overwrite_me bit works in moz, but ffx always opens a new tab
weather requested or not.
comments? suggestions?
anyone wanna test it in galeon or epiphany?

Here's some info on how it works.
http://www.mozilla.org/unix/remote.html
http://ietfreport.isoc.org/idref/rfc2397/

Have phun! :-)

Offline

#2 2005-05-20 13:27:33

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: script to get new posts

There are about >50 new posts a day, and you want to open them all in a seperate tab? Madness.

How I do it:

Go to bbs.archlinux.org/search.php?search_id=newposts to see a list of new posts. Then scan for interesting stuff by title and opening it in a new tab, thus avoiding to read 90% of the stuff I'm not interested in. Bad luck for people who need help and chose a crap title, but that's what titles are for.

Offline

#3 2005-05-20 14:33:57

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: script to get new posts

I do the same, but phpBB does a bad job at remembering *the last message I have read* (compared to IPB, for example).

Offline

#4 2005-05-20 14:50:02

Vinny
Member
From: the fifth floor
Registered: 2005-04-25
Posts: 29

Re: script to get new posts

i3839 wrote:

There are about >50 new posts a day, and you want to open them all in a seperate tab? Madness.

it opens sub-forums, not individual posts, so at most 22 tabs.

Offline

#5 2005-05-20 15:07:29

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: script to get new posts

I just used the colored icons... and click on the ones which seem interesting

Offline

Board footer

Powered by FluxBB