Background

I like the idea of bounties and the recent bounties people have offered. They seem to be effective, so I though I would try to start one myself.

I am offering a bounty on the completion of a usenet module that meets the below specifications. My offering is $100 USD and I hope others will contribute financially as well in order to encourage a developer to undertake the task. If you are a developer and have begun developing this module, please comment here so we can avoid duplicating efforts.
<--break-->
At one point, many months ago, I had a semi-working usenet module (far from complete, but it was a start) but have lost the code. My TODO list is always growing and I do not foresee having time to undertake this development myself.

Module Description

Seamlessly synchronize a specified forum with a specified newsgroup. This integration should be relatively transparent to users of the drupal site. If someone named ‘johnny’ posts to the newsgroup directly, users of the drupal site would see that post as being by an anonymous user named ‘johnny’, etc.

The admin user(s) should still be capable of deleting posts. When a post is deleted, any future replies to it would not be imported into the forum either.

Module Functionality

The module will ‘synchronize’ the specified forum(s) with the specified newsgroup(s) on a set interval by means of the _cron() hook. At this point, the module will push new forum postings by users of the drupal site to the news server(s) and pull new posts from the news server(s) to be imported into the forum(s).

Threading shall be maintained for posts originating from either source and combined. By this I mean that outgoing posts originating from the drupal site should contain all pertinent header information including the post ID it is in response to (if applicable).

For outgoing posts, the senders name and email address will be configurable (see admin options).

Optional text will be appended to outgoing posts. As an example, one may find it desirable to add text such as;

----
Posted via drupal.org by username ‘mork’

Text quoting will be handled elegantly. Users of newsgroups and users of forums generally behave as polar opposites with respect to quoting. Forum users generally post without quoting any text unless absolutely necessary. Usenet posters generally quote text as a rule.

As a result, I foresee two ‘filters’, one for incoming posts and one for outgoing posts. The outgoing post filter should do the following;

  • Look for the occurrence of quoted text (blockquote, cite, etc)
  • If there is quoted text, no need to add any. Else, add quoted text (quote text of parent node/comment if it has a parent).
  • Convert blockquote/cite/whatever into usenet style quoting (generally each line beginning with ‘>’).
  • Strip all HTML from outgoing posts.

The incoming posts filter should do the following:

  • Inspect quoted text and strip the ‘>’ characters from the beginning of the lines.
  • Compare this quoted text to the posts parent
  • If it is believed the quoted text has quoted the entire post (a default of many news readers when replying) then remove the quoted text.
  • If it is believed the quoted text has been selectively quote and is sufficiently short (see admin config) then convert it to bloquote/cite/quote/whatever and let it remain in the post.

I envision some heavy use of regular expressions to elegantly accomplish the above.
Also note that many news readers add a line preceding their quoted text that does not begin with a ‘>’ character and we need to catch as many of these as possible (although they are endless in their incarnations). It may be something like;

On 05/06/2005, mork <…@...> said the following:

Configuration (Admin -> Settings -> Usenet)

  1. There needs to be a way to specify a newsgroup for a specific forum. Here newsgroup would mean news server, port, username, password, newsgroup name. Each forum that is synchronized with a newsgroup need not be from the same news server.
  2. Text to be appended to outgoing posts. Should have a variable (something like %username%) so something like the example described above is possible.
  3. Name for ‘from’ field for outgoing posts. This should again permit the %username% variable.
  4. Email address for ‘from’ field for outgoing posts.
  5. Number of posts to retrieve. This is for the initial pull to prevent pulling everything the news server has to offer. Subsequent pulls should retrieve only new posts.
  6. Checkbox option: enable ‘smart quoting’ on outgoing posts.
  7. Checkbox option: enable ‘smart quoting’ on incoming posts.
  8. Number of lines to be considered a long quote (for incoming posts, threshold to determine if quote should be stripped or not when importing).
  9. # of minutes between synchronizing (assumed cron runs at least this often, but potentially more frequently).

Probably some other obvious options are needed that I missed out on.

Technical Details

I leave that up to you. The one requirement is that the module be self contained and require no modifications to core code. My approach included an additional table to keep track of some relationships and to tag what had been exported/what is new/etc. There's plenty of documentation and open source scripts for performing all of the communication and exchanging with the news server that you will find useful.

Note: it is ok to assume a one-to-one relationship (i.e. no need to allow multiple newsgroups to be synchronized with a single forum and vice-versa.)

Comments

chx’s picture

USD 100 is by far not enough for me to tackle the pnews SF project and Drupal integration but I thought it worths mentioning that the NNTP part is done.

--
Read my developer blog on Drupal4hu.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

matthew’s picture

PHP News Reader (http://news.hacettepe.edu.tr/doc/index.php) might also be of some help as a jumping off point for module development.

Best,

Matthew

boris mann’s picture

You've done a great job of detailing what you would like to see. Now, you need to get in touch with a developer to get an estimate of what the total cost would be to have this developed.

Next step: promote your idea! Look for other people seeking this functionality, point links to this post, and generally gather support.

Good luck!

pamphile’s picture

I want to help fund this usenet module.

When donor funds are needed send me a message via my Drupal contact form.

I was about to spend $150+ for a VBulletin license + the Vbulletin usenet plugin, but a drupal module would be more interesting. Will see what happens.

Marcel
YP.BZ - Yellow Page Dot Business

janb’s picture

Google's Summer of Code was kind enough to sponsor the initial development of what you were asking for.

A first testable version can be found inCVS, and the project page is here: http://drupal.org/node/29816

Be aware that I do plan to change the database table layout before I make a first official release of the module. I will not provide any migration scripts, so if you use the current version for something else than evaluation/testing, you'll have some work to do when you upgrade to a next version.

Jan Blom

pamphile’s picture

Great I'll give it a test ....

Marcel
SOHO Resource
International Classifieds

pamphile’s picture

Some feedback...
I added the module, and a group from teranews.com.
I am trying to fetch news from comp.lang.php.
I opened cron.php

no news is arriving... hmm

I enabled these options:
Synchronize often
Synchronize on exit
Netnews tracing

Some error logs I am seeing:

Location /drupal46/admin/netnews/edit/1?destination=admin%2Fnetnews
Message Query was empty query: in c:\appserv\www\drupal46\includes\database.mysql.inc on line 66.
Severity error
Hostname 127.0.0.1

-----

Message mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\appserv\www\drupal46\includes\database.mysql.inc on line 129.
Severity error
Hostname 127.0.0.1

http://01edit.com

janb’s picture

In the modules/netnews directory you should now have a trace file for that link (the netnews tracing writes a file there). It might give clues that point to code in the netnews module. That might give you, or me, some clues as to what is happening.

pamphile’s picture

oh ok interesting, I get this:

2005-09-14 02:10: name rejected:
2005-09-14 02:10: username rejected:
2005-09-14 02:22: username rejected:
2005-09-14 02:23: name rejected: comp.lang.php
2005-09-14 02:25: _netnews_synchronize_all_links()
2005-09-14 02:25: _netnews_synchronize_link(1)
2005-09-14 02:26: Fixing taxonomy
2005-09-14 02:31: _netnews_synchronize_all_links()
2005-09-14 02:31: _netnews_synchronize_link(1)
2005-09-14 02:32: _netnews_synchronize_all_links()
2005-09-14 02:32: _netnews_synchronize_link(1)
2005-09-14 02:35: _netnews_synchronize_all_links()
2005-09-14 02:35: _netnews_synchronize_link(1)

Marcel
http://01edit.com
http://goingtochina.com

pamphile’s picture

next week, I'll download the latest version again, and post screenshots of errors I encountered.

http://drupalhacks.com - coming soon