Thread View: news.software.nntp
3 messages
3 total messages
Started by Michael Vogel
Fri, 31 Jul 2009 20:10
starting external programm when an article is posted
Author: Michael Vogel
Date: Fri, 31 Jul 2009 20:10
Date: Fri, 31 Jul 2009 20:10
21 lines
1769 bytes
1769 bytes
Hi! I'm using inn and I'm trying to write a sync program between a newsserver and a forum. For this I have to start a program whenever a post is done. I know that the config file is "newsfeeds" and I already managed to create an entry that starts a programm whenever a post is done. But: How can the script fetch the message? All that the script gets is some kind of data like @050000000000900000000680000000@ What can I do to fetch the message? The script is written in php. The newsfeeds looks like this: newsforum:!*,news.test:Tp:/path/to/file.php %s Is there any example I could use to see what I have done wrong? Thanks! Michael
Re: starting external programm when an article is posted
Author: Alexander Bartolich
Date: Fri, 31 Jul 2009 20:33
Date: Fri, 31 Jul 2009 20:33
44 lines
2700 bytes
2700 bytes
Michael Vogel schrieb: > [...] > But: How can the script fetch the message? All that the script gets is > some kind of data like @050000000000900000000680000000@ That's the storage token. > What can I do to fetch the message? The script is written in php. You can use command line program "sm" to retrieve the message. For example: $ grephistory '<4a734fa9$0$30230$9b4e6d93@newsspool1.arcor-online.net>' @03034249473300000000004F217000000002@ $ sm @03034249473300000000004F217000000002@ | grep ^From From: Michael Vogel <ike@spamfence.net> > The newsfeeds looks like this: > > newsforum:!*,news.test:Tp:/path/to/file.php %s > > Is there any example I could use to see what I have done wrong? If all else fails, read the manual. man newsfeeds The third field (which you have set to "Tp") is described in section "FLAG VALUES" of the manual page. Section "FEED TYPES" then gives additional notes about program feeds. With a program feed (type "Tp") a new process is spawned for every incoming message. This is well suited for shell scripts, which then can use "sm" to retrieve the message. To get more performance you should choose "Tc" (channel) and use the "W" flag to select what data you want to read from stdin. -- Brüder, in die Tonne die Freiheit, Brüder, ein Stoppschild davor. Egal was die Schwarzen Verlangen Rufen wir: Ja! Brav im Chor.
Re: starting external programm when an article is posted
Author: Michael Vogel
Date: Fri, 31 Jul 2009 20:40
Date: Fri, 31 Jul 2009 20:40
13 lines
1534 bytes
1534 bytes
Moin! Alexander Bartolich schrieb: > If all else fails, read the manual. > > man newsfeeds RTFM to me ... I found it there the second after posting ... Michael
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads