GithubHelp home page GithubHelp logo

mmitch / whatsnewfm Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 307 KB

a filter for the daily newsletter from freshmeat.net

Home Page: http://www.cgarbs.de/whatsnewfm.en.html

License: GNU General Public License v2.0

Perl 100.00%

whatsnewfm's Introduction


  whatsnewfm 0.7.1
  ~~~~~~~~~~~~~~~~

 2009/05/30

 (c) 2000-2009 by Christian Garbs <[email protected]>
                  Joerg Plate <[email protected]>
                  Dominik Brettnacher <[email protected]>
                  Pedro Melo Cunha <[email protected]>
                  Matthew Gabeler-Lee <[email protected]>
                  Bernd Rilling <[email protected]>
                  Jost Krieger <[email protected]>

 Licensed under GNU GPL (see COPYING for details)



  Contents
  ~~~~~~~~

  Description . . . . . . . . . . . . . .  1
  Contact . . . . . . . . . . . . . . . .  2
  Requirements  . . . . . . . . . . . . .  3
  Usage . . . . . . . . . . . . . . . . .  4
  The configuration file  . . . . . . . .  5
  The "hot" database  . . . . . . . . . .  6
  Data import from v0.4.x . . . . . . . .  7
  Manpage . . . . . . . . . . . . . . . .  8
  Download  . . . . . . . . . . . . . . .  9
  Thanks  . . . . . . . . . . . . . . . . 10



     Feel free to contact the author at <[email protected]>
     for any questions or suggestions.



  [1] Description
  ~~~~~~~~~~~~~~~

whatsnewfm is a utility to filter the daily newsletter from
http://freecode.com

The main purpose is to cut the huge newsletter to a smaller size by
only showing items that you didn't see before.

The items already seen will be stored in a database.  After some time,
the items expire and will be shown again the next time they are
included in a newsletter.

If you find an item that you consider particularly useful, you can add
it to a "hot" list.  Items in the hot list are checked for updates so
that you don't miss anything about your favourite programs.



  [2] Contact
  ~~~~~~~~~~~

Please contact me by email: Christian Garbs <[email protected]>

If you encounter a bug, please tell me.  Known bugs will be listed in
the issue tracker and you might find a cure for it in the git
repository if I have not yet released a new version.  See [9] for
further information.



  [3] Requirements
  ~~~~~~~~~~~~~~~~

* procmail, maildrop or something else (otherwise you will have to
  send every newsletter through the filter by hand)

* perl, sendmail or sendmail-compatible mailer

* BerkeleyDB Perl module



  [4] Usage
  ~~~~~~~~~

1) Extract the archive to a directory of your favour.

2) Copy the file "whatsnewfmrc.sample" to "~/.whatsnewfmrc" and edit
   it to your needs.  See [4] for details.

3) Add the following lines to your ~/.procmailrc to send all
   newsletters through the whatsnewfm filter:

:0 w :
* ^Subject: Freecode Daily Update:
* !^X-Loop:.*whatsnewfm
| /path/to/whatsnewfm.pl

   Alternatively, if you are using maildrop, you need to add something
   like this to your ~/.mailfilter:

if (/^Subject: Freecode Daily Update:/ && !/^X-Loop:.*whatsnewfm/)
{
  xfilter "/path/to/whatsnewfm.pl"
}

4) Add whatsnewfm to your hot database: "whatsnewfm.pl add whatsnewfm"

5) Check your setup by mailing the file "welcome" to yourself with
   "Freecode Daily Update: TEST" as subject:

     mail -s "Freecode Daily Update: TEST" your@email < welcome

   You should then receive an update information for the whatsnewfm
   application.  This is good.  Otherwise, there is an error in your
   setup.

6) If you're not yet subscribed to the freecode newsletter, do so at
   http://freecode.com

7) If one of the new applications is interesting to you, then add
   it to your "hot" database. See [6] for details.



  [5] The configuration file
  ~~~~~~~~~~~~~~~~~~~~~~~~~~

The configuration file is a plain text file in your home directory
named ".whatsnewfmrc".  The location and name of the configuration
file can be changed with the -c option.  Lines beginning with "#" are
treated as comments.  Other lines consist of keywords and values:

  KEYWORD=VALUE

You need to specify the following keywords:

* MAILTO=email@address
  This is the eMail address to which the filtered newsletter and the
  updates of "hot" programs are sent.

* DB_NAME=~/.whatsnewfm.db
  This is the filename where the "hot" and "old" databases are kept.

* EXPIRE=12
  After this time (in months) an entry from the "old" database expires.

* UPDATE_MAIL=single
  All updates of "hot" applications from one newsletter are sent
  in one single eMail.  If you would like to have a unique eMail for
  every application, set this key to "multiple" instead of "single".

* SUMMARY_AT=bottom
  Prints the summary at the bottom of a processed newsletter.  If you
  want the summary to be printed at the top, set this to "top".
  Default value is 'bottom'.

* LIST_SKIPPED=no
  Show a list the skipped news items (low score and already seen).
  Possible values are 'no' (no list), 'bottom' or 'top'.
  Default value is 'no'.

* MAIL_CMD=/usr/lib/sendmail
  This is the location of your sendmail command (or any command
  that can be called in the same way as sendmail).

* MAIL_OPT=-oi -t
  Your sendmail command is called with these parameters.

* SCORE=<score> <TAB> <regexp>
  This enables scoring of newsletter items (release text and
  articles).  This keyword can appear multiple times (it may also be
  omitted).  Each value consists of a score (either a negative or
  positive integer value) and a regular expression, both separated by
  a tabulator (\t).  If the regular expression is found within the
  descriptive text of a news item, the score value is added to the
  score of that news item.  Regular expressions are matched
  case-insensitive.  The news items then are listed according to their
  score values.  To learn more about perl regexps, confer the
  "perldoc perlre" help page.

* CATSCORE=<score> <TAB> <regexp>
  This works exactly like the SCORE keyword, except that not the
  release text but the Freshmeat Category fields are scored.
  Try "CATSCORE=+100<TAB>Editorial" to mark all editorial articles.

* LICSCORE=<score> <TAB> <regexp>
  This works exactly like the SCORE keyword, except that not the
  release text but the Freshmeat License fields are scored.
  Try "LICSCORE=-50<TAB>Proprietary" to score down all proprietary
  software.

* SCORE_MIN=-999
  Newsletter items with a score lower than this value will not be
  displayed.


If an essential keyword is missing, you will get a message like this:

 *  using default value for "MAIL_OPT"

Add the keyword to your configuration file to get rid of the message.



  [6] The "hot" database
  ~~~~~~~~~~~~~~~~~~~~~~

This database contains the applications that you are interested in.
You will be informed of every update within these applications.  The
applications are identified by the "project id" that is shown in the
parsed freecode newsletter.

To see what is in the database, just may use "less" or "cat" on the
database file (although the 'view' command (see below) should be used,
that's what I wrote it for).

To edit the database, please use the whatsnewfm commands as shown
below - DON'T edit the files with a text editor.  Some strange things
might happen when you edit the database while whatsnewfm is running in
the background (your text editor won't recognize a lock on the
database).

These examples use the project id "whatsnewfm" - in case you forgot:
That's the program you're just reading about.



To view all applications that are in the database, just type this:

  whatsnewfm.pl view

This just prints the whole database file on stdout.  If you want to
cut the output down to some entries, you can add a regular expression
to the view command (instead of using grep):

  whatsnewfm.pl view ^li

This will print all entries entries starting with "li".
The regular expression is always matched case-insensitive.



To add an application to the database, just type this:

  whatsnewfm.pl add whatsnewfm

You can enter a comment to help you remember what this application
does (good for project ids that are acronymns):

  whatsnewfm.pl add whatsnewfm Parses the freecode newsletter.

If you want to enter multiple applications (eg copy'n'paste while
reading the new freecode newsletter) you can start whatsnewfm like
this:

  whatsnewfm.pl add

whatsnewfm.pl then reads from stdin.  Every line must begin with a
project id.  Comments might follow after a whitespace character
(space, tab or the like).  If you're finished, press CTRL-D.  All
entered applications will be added to the "hot" database.



Deleting applications is as easy as adding applications.  You can give
the project ids directly (just one or even more):

  whatsnewfm.pl del whatsnewfm

You can also give the ids on stdin (like the add command):

  whatsnewfm.pl del

This time multiple project ids are allowed on one line when they are
separated by whitespaces.



  [7] Data import from v0.4.x
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~

To import your "hot" database from an older version, run this small
shell script.  Replace ~/.whatsnewfm.db.hot with the filename of your
"hot" database from version 0.4.x.

  while read LINE ; do
    ./whatsnewfm.pl add $LINE
  done < ~/.whatsnewfm.db.hot


To import your "old" database, use this Perl script.  Change
$new_database and $old_database to the filenames you actually use.

#!/usr/bin/perl
use warnings;
use strict;
use BerkeleyDB::Hash;
my $new_database = "~/.whatsnewfm.db";
my $old_database = "~/.whatsnewfm.db.old";
my $count = 0;
$new_database =~ s/^~/$ENV{HOME}/;
$old_database =~ s/^~/$ENV{HOME}/;
my $db_env = new BerkeleyDB::Env, BerkeleyDB::DB_INIT_CDB;
my %hash;
tie %hash, 'BerkeleyDB::Hash',
{ -Filename => $new_database,
  -Subname => "old",
  -Flags => BerkeleyDB::Hash::DB_CREATE
  };
open OLD, "<$old_database" or die "can't open `$old_database': $!";
while (<OLD>) {
    my ($p, $t) = split /\t/;
    $hash{$p} = $t;
    $count++;
}
close OLD or die "can't close `$old_database': $!";
untie %hash;
print "$count old projects imported.\n";



  [8] Manpage
  ~~~~~~~~~~~

A manpage is included in the whatsnewfm Perl script.  You can extract
it with the pod2* commands.  For example:

  pod2man  whatsnewfm.pl whatsnewfm.pl.1
  pod2text whatsnewfm.pl whatsnewfm.txt
  pod2html whatsnewfm.pl whatsnewfm.html



  [9] Download
  ~~~~~~~~~~~~

* You can download new and old versions of whatsnewfm from these
  locations:

  http://www.cgarbs.de/whatsnewfm.en.html
  http://whatsnewfm.sourceforge.net/

* Unreleased development versions are available from the git
  repository:

  web:    http://github.com/mmitch/whatsnewfm
  clone:  git://github.com/mmitch/whatsnewfm.git

* Issue tracking is currently switchen over from ditz to github:

  http://github.com/mmitch/whatsnewfm/issues
  http://www.cgarbs.de/ditz/whatsnewfm/



  [10] Thanks
  ~~~~~~~~~~~

* Again many thanks to everybody who informed me when the newsletter
  format changed again in March 2009.  As I lost my newsletter
  subscription during the Freshmeat relaunch, I really didn't notice
  myself.

* Bernd Rilling sent a patch for the newletter format mentioned above
  (sourceforge bug #2691997, fixed in v0.7.0).

* Jost Krieger sent a patch to score the license of releases
  (included in v0.7.0).

* Dave Woolaway suggested the use of multiline regexp matches for
  scoring (sourceforge feature request #930403, included in v0.6.5).

* Matthew Gabeler-Lee <[email protected]> wrote a patch to fix '=20'
  appearing in mails sent by whatsnewfm (sourceforge bug #891520,
  fixed in v0.6.4).

* scottbbbb pointed out that the sendmail options should be
  configurable (sourceforge bug #728895, fixed in v0.6.3,
  backported to v0.4.15).

* Scott reported a bug with multiline subjects within the newsletter
  (sourceforge bug #726261, fixed in v0.6.2, backported to v0.4.14).

* Josef 'Jupp' Schugt <[email protected]> made some annotations to the
  expire algorithm for the 'old' database (changes included on v0.6.2
  and backported to v0.4.14).

* Roger H. Goun <rgoun at sourceforge> reported a bug in the RPMs of
  v0.4.12.

* Matthias Kluwe <[email protected]> discovered and fixed the warnings
  under Perl 5.8.0 (fixed in v0.4.11).  He also made some annotations
  to the README (included in v0.4.4).  

* Edelhard Becker <[email protected]> was the first to inform me
  about the format change that was fixed in v0.4.10.

* Nikolaus Filus <[email protected]> requested the new features in v0.4.9.

* Jost Krieger <[email protected]> noticed and fixed the
  missing Categories in the 'hot' mails (fixed in v0.4.7).

* Francisco <[email protected]> suggested the scoring of
  Freshmeat categories (included in v0.4.6).

* Pedro Melo Cunha <[email protected]> sent a patch to move the
  newsletter summary to the top of the mail (included in v0.4.3).

* Eugen Dedu <[email protected]> reported the missing Project ID in
  "hot" mails (fixed in v0.4.3).  He also suggested to include the
  comments from the "hot" database in an update notification.

* Dominik Brettnacher <[email protected]> sent a patch to
  include the freshmeat editorials into the list of new applications
  (included in v0.2.5).

* Joerg Plate <[email protected]> sent a patch for those annoying
  warnings with Perl 5.6 (fixed in v0.2.4).

* Piotr Sieklucki <[email protected]> provided the initial
  version of the whatsnewfm RPM and .deb packages.  He also suggested
  the SCORE_MIN feature and maintained the mirror at wombat.eu.org for
  some time.

* All those people who told me that whatsnewfm didn't work any more
  when freshmeat changed the newsletter format.  Apparently someone
  really uses this piece of software :-)

* Michael Reinsch <[email protected]> for keeping on asking and not being
  convinced by my wrong thoughts.  Only because of him versions beyond
  v0.0.1 do exist.

whatsnewfm's People

Contributors

fmarier avatar mmitch avatar

Watchers

 avatar  avatar

Forkers

pombredanne

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.