Ezine Article Download

Khalil

American Airlines
Jan 6, 2012
373
1
0
Europe
Hey fellas,

While looking for some articles I came across ezine.com. I asked myself if it's worth it to write a little scrape tool. Finally I decided to build one to speed up my workflow...

However, I decided to share it with you guys.. It's pretty simple and nothing special. (Maybe it will stop working in a few days, weeks, month because ezine is changing things from time to time)

Have fun with it.. (PS: .net Framework 4 is required)

Khalil

Ezine Article Download.rar (7,19 KB) - uploaded.to (Password: wickedfire)

screengv.png
 


Here's a nasty perl script for non-Windows guys that eats the first page of results into ./articles/$query.

Code:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use File::Path;

my $query = shift or die "Need a search term! usage: ezine.pl \"travel plans\"";
$query =~ tr/ /+/;
mkpath "articles/$query" or die "Couldn't make target 'articles/$query' directory: $!" unless (-d "articles/$query");
my $results = get "http://ezinearticles.com/search/?q=" . $query;

while ($results =~ m|<div class="result-title">\s+<h3>\s+<a href="/\?([\w\-\&\=\d;]+)">|gs) {
        my $title = $1;
        my $article = get "http://ezinearticles.com/?". $title;
        if ($article =~ m|<div id="article-content">\s+(.*)</div>\s+<div id="article-resource">|gs) {
                my $content = $1;
                $content =~ s!(</p>|<b>|</b>)!!g;
                $content =~ s|<p>|\n|g;
                open (my $fh, '>', "./articles/$query/$title");
                print $fh $content;
        }
}
print "done\n";

(Yeah yeah, I'm regexing against HTML. It's saturday :bootyshake:)
 
Hey stan, usually I don't spread complete source codes of my projects around but if you need help with something specific feel free to ask.
However, it's basically your perl code translated to c# ! ;)

Khalil