Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SCRIPT] per il forum...
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
PboY
Apprentice
Apprentice


Joined: 02 Feb 2005
Posts: 238
Location: Italia - Monza

PostPosted: Sun Apr 10, 2005 5:13 pm    Post subject: [SCRIPT] per il forum... Reply with quote

so che per qualcuno sembrerà inutile ma gente che come me usa torsmo e simili interesserà (spero :))
Code:

#!/bin/bash

#url of the gentoo forum
FGENTOO_URL=http://forums.gentoo.org/viewforum-f-41.html
#download file name
FGENTOO_URL_OUTPUT=gentoo.html
#temporary file
FGENTOO_URL_OUTPUT_TEMP=$FGENTOO_URL_OUTPUT.tmp
#max result number
FGENTOO_MAX_RESULT=5

if [ ! -d ~/.fgentoo/ ]
then
        mkdir ~/.fgentoo
fi
wget -q -nv -O ~/.fgentoo/$FGENTOO_URL_OUTPUT http://forums.gentoo.org/viewforum-f-41.html
grep topictitle ~/.fgentoo/$FGENTOO_URL_OUTPUT > ~/.fgentoo/$FGENTOO_URL_OUTPUT_TEMP
grep -v Sticky ~/.fgentoo/$FGENTOO_URL_OUTPUT_TEMP > ~/.fgentoo/$FGENTOO_URL_OUTPUT
grep -v Announcement: ~/.fgentoo/$FGENTOO_URL_OUTPUT > ~/.fgentoo/$FGENTOO_URL_OUTPUT_TEMP
head -n $FGENTOO_MAX_RESULT ~/.fgentoo/$FGENTOO_URL_OUTPUT_TEMP > ~/.fgentoo/$FGENTOO_URL_OUTPUT
html2text ~/.fgentoo/$FGENTOO_URL_OUTPUT


non fa altro che scaricare la pagina del forum in italiano, togliere i post in sticky e gli announcement per buttarne fuori l'output in formato testo...

per farlo andare copiate tutto in un file e date un
Code:

chmod +x nomefile

oltre a questo è necessario anche html2text che è in portage, quindi diamo
Code:

emerge html2text

fatto questo lanciamo ./nomefile ed avremmo i topic in console :)

spero sia utile a qualcuno :)
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Sun Apr 10, 2005 5:45 pm    Post subject: Re: [SCRIPT] per il forum... Reply with quote

PboY wrote:
non fa altro che scaricare la pagina del forum in italiano, togliere i post in sticky e gli announcement per buttarne fuori l'output in formato testo...


Elimini le cose inutili, insomma :roll:
_________________
Ciao da me!
Back to top
View user's profile Send private message
PboY
Apprentice
Apprentice


Joined: 02 Feb 2005
Posts: 238
Location: Italia - Monza

PostPosted: Sun Apr 10, 2005 6:31 pm    Post subject: Re: [SCRIPT] per il forum... Reply with quote

randomaze wrote:
PboY wrote:
non fa altro che scaricare la pagina del forum in italiano, togliere i post in sticky e gli announcement per buttarne fuori l'output in formato testo...


Elimini le cose inutili, insomma :roll:


no, che vuol dire... serve solamente per vedere i topic piu recenti. non che io reputi gli sticky etc.. inutili, ma per il suo scopo non servono ... si otterrebbe un output troppo lungo, no ? :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum