View Single Post
Old 10-22-2014, 11:58 AM   #5
sakib
Nameless Being
 
what I did is mangle original recipe a bit:
Code:
diff --git a/recipes/lwn_weekly.recipe b/recipes/lwn_weekly.recipe
index 6392772..b4055ef 100644
--- a/recipes/lwn_weekly.recipe
+++ b/recipes/lwn_weekly.recipe
@@ -9,6 +9,7 @@
 from calibre.web.feeds.news import BasicNewsRecipe
 import re
 import sys
+import os
 
 class WeeklyLWN(BasicNewsRecipe):
     title = 'LWN.net Weekly Edition'
@@ -72,7 +73,9 @@ def parse_index(self):
         if self.username is not None and self.password is not None:
             index_url = self.print_version('/current/bigpage')
         else:
-            index_url = self.print_version('/free/bigpage')
+            issue = os.environ.get('OVERRIDE_LWN_ISSUE')
+            index_url = self.print_version("/Articles/%s/bigpage" % issue)
+            print >>sys.stderr, "overriden issue %s" % index_url
         soup = self.index_to_soup(index_url)
         curr = soup.body
         if curr.h1.string is not None:
and use it together with small shell script, plus list of issues grabbed from my RSS reader:
Code:
#!/bin/bash
counter=0
for OVERRIDE_LWN_ISSUE in 515278 514343 510440...; do
	if [ -f ./out/lwn_$counter.epub ]; then
		((counter++));
		continue
	fi
	echo process $OVERRIDE_LWN_ISSUE $counter;
	export OVERRIDE_LWN_ISSUE
	ebook-convert ./lwn_weekly.recipe ./out/lwn_$counter.epub ;
	if [ $? != 0 ]; then
		echo "processing issue $OVERRIDE_LWN_ISSUE $counter failed"
		exit
	fi
	((counter++));
done
Converted this way all issues for last 2 years.
Not sure that somebody needs this, but I just leave it here anyway.
  Reply With Quote