By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

How to parse usenet urls?

P: n/a
I'm trying to parse newsgroup messages, and I need to follow URLs in
this format: news://some.server. I can past them into a newsreader
with no problem, but I want to do it programatically.

I can't figure out how to follow these links - anyone have any ideas?

May 31 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11**********************@h2g2000hsg.googlegroups. com>,
"sn*******@gmail.com" <sn*******@gmail.comwrote:
I'm trying to parse newsgroup messages, and I need to follow URLs in
this format: news://some.server. I can past them into a newsreader
with no problem, but I want to do it programatically.

I can't figure out how to follow these links - anyone have any ideas?
Are you aware of nntplib?

http://docs.python.org/lib/module-nntplib.html

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
May 31 '07 #2

P: n/a
Are you aware of nntplib?
>
http://docs.python.org/lib/module-nntplib.html
I am, but I once I got into the article itself, I couldn't figure out
how to "call" a link inside the resulting message text:

import nntplib
username = my username
password = my password
nntp_server = 'newsclip.ap.org'
n = nntplib.NNTP(nntp_server, 119, username, password)
n.group('ap.spanish.online.headlines')

m_id = n.next()[1]
n.article(m_id)
I'll get output like this headline and full story message link:
(truncated for length)
>>... 'Castro: Bush desea mi muerte, pero las ideas no se matan', 'news://newsclip.ap.org/D8*******@news.ap.org', ...
How can I take the message link 'news://newsclip.ap.org/
D8*******@news.ap.org' and follow it?
May 31 '07 #3

P: n/a
In article <11**********************@k79g2000hse.googlegroups .com>,
"sn*******@gmail.com" <sn*******@gmail.comwrote:
Are you aware of nntplib?

http://docs.python.org/lib/module-nntplib.html

I am, but I once I got into the article itself, I couldn't figure out
how to "call" a link inside the resulting message text:
>... 'Castro: Bush desea mi muerte, pero las ideas no se matan',
'news://newsclip.ap.org/D8*******@news.ap.org', ...

How can I take the message link 'news://newsclip.ap.org/
D8*******@news.ap.org' and follow it?
OK, gotcha. I misunderstood your original question. Perhaps this is just
a synonym for "nntp:"? THis sounds like a dangerous assumption and
hopefully someone more knowledgeable will come along and shoot me down.
=) But when I fire up Ethereal and paste that news: URL into my browser,
Firefox launches my newsreader client and Ethereal reports that my
client connects to the remote server at the NNTP port (119), sends an
NNTP LIST command and Ethereal identifies the subsequent conversation as
NNTP.

If I were you I'd try handling news: URLs with nttplib. I bet it will
work.

Sorry I couldn't provide more than guesses. Good luck!

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
May 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.