diff --git a/resources/recipes/hawaii.recipe b/resources/recipes/hawaii.recipe new file mode 100644 index 0000000000..30a2b26def --- /dev/null +++ b/resources/recipes/hawaii.recipe @@ -0,0 +1,55 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1282101454(BasicNewsRecipe): + title = 'West Hawaii Today' + language = 'en' + __author__ = 'Tony Stegall' + description = 'Westhawaiitoday.com' + publisher = 'West Hawaii ' + category = 'news,Hawaii,USA' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + remove_javascript = True + + masthead_url = 'http://images.townnews.com/westhawaiitoday.com/art/whttoplogo.gif' + + + + + + feeds = [ + ('Local News', 'http://www.westhawaiitoday.com/?rss=local/'), + ('Local Sports', 'http://www.westhawaiitoday.com/?rss=sports/local_sports/'), + ('Big Fish List', 'http://www.westhawaiitoday.com/?rss=sports/big_fish_list/'), + ('Local Features' 'http://www.westhawaiitoday.com/?rss=features/'), + ('Obituaries', 'http://www.westhawaiitoday.com/?rss=obituaries/'), + ('Letters To Editor', 'http://www.westhawaiitoday.com/?rss=opinion/letters_-_your_voice/'), + ('Editorial', 'http://www.westhawaiitoday.com/?rss=opinion/editorial/'), + ('Columns', 'http://www.westhawaiitoday.com/?rss=opinion/columns/'), + ('Volcano Update Sunday', 'http://www.westhawaiitoday.com/?rss=volcano/') + ] + + def print_version(self, url): + split1 = url.split("//") + url1 = split1[1] + xxx = split1[2] + split2 = xxx.split(".") + artid = split2[0] + print 'ARTICLE ID IS: ', artid + + #example of link to convert + #Original link: http://www.westhawaiitoday.com/articles/2010/08/27/local//local01.txt + #print version: http://www.westhawaiitoday.com/articles/2010/08/27/local//local01.prt + + print_url = 'http://' + url1 + '//' + artid + '.prt' + print 'print_url is: ', print_url + return print_url + + #test with ebook-convert hawaii.recipe output_dir --test -vv > myrecipe.txt + + + + + + diff --git a/resources/recipes/mdj.recipe b/resources/recipes/mdj.recipe new file mode 100644 index 0000000000..b7a5fe0d63 --- /dev/null +++ b/resources/recipes/mdj.recipe @@ -0,0 +1,50 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1282101454(BasicNewsRecipe): + title = 'Marietta Daily Journal' + __author__ = 'Tony Stegall' + language = 'en' + description = 'Marietta Ga and Metro Atlanta News' + publisher = 'MDJ' + category = 'news,politics,Georgia,USA' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + remove_javascript = True + + masthead_url = 'http://assets.matchbin.com/sites/624/assets/logo.gif' + + + keep_only_tags = [ + dict(name='div', attrs={'id':['print_content_container']}) + + ] + + + feeds = [ + ('Local News', 'http://mdjonline.com/rss/rss/Local+News?content_type=article&tags=news&page_name=rss&tag_inclusion=or&offset=0&limit=10&instance=Local+News'), + ('Sports', 'http://mdjonline.com/rss/rss/Sports?content_type=article&tags=sports&page_name=rss&tag_inclusion=or&offset=0&limit=10&instance=Sports'), + ('Obits', 'http://mdjonline.com/rss/rss/Obits?content_type=article&tags=obits&page_name=rss&tag_inclusion=or&offset=0&limit=20&instance=Obits'), + ('Editorial & oped', 'http://mdjonline.com/rss/rss/Editorial+and+OPED?content_type=article&tags=oped+editorial&page_name=rss&tag_inclusion=or&offset=0&limit=10&instance=Editorial+and+OPED'), + ('Lifestyle', 'http://mdjonline.com/rss/rss/Lifestyle?content_type=article&tags=lifestyle&page_name=rss&tag_inclusion=or&offset=0&limit=10&instance=Lifestyle'), + ('Blogs', 'http://mdjonline.com/rss/rss/Lifestyle?content_type=article&tags=lifestyle&page_name=rss&tag_inclusion=or&offset=0&limit=10&instance=Lifestyle') + ] + + def print_version(self, url): + split1 = url.split("/") + artid = split1[4] + + #example of link to convert + #Original link: http://mdjonline.com/bookmark/9274197 + #print version: http://mdjonline.com/printer_friendly/9274197 + + print_url = 'http://mdjonline.com/printer_friendly/' + artid + return print_url + + #test with ebook-convert nejm.recipe output_dir --test -vv > myrecipe.txt + + + + + + diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 51c74228b7..d57bfddd3e 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -491,6 +491,9 @@ class HTMLInput(InputFormatPlugin): return (None, raw) def preprocess_html(self, html): + if not hasattr(self, 'log'): + from calibre.utils.logging import default_log + self.log = default_log self.log("********* Preprocessing HTML *********") # Detect Chapters to match the xpath in the GUI chapdetect = re.compile(r'(?=]*>)?\s*(?P(<(i|b)><(i|b)>|<(i|b)>)?(.?Chapter|Epilogue|Prologue|Book|Part|Dedication)\s*([\d\w-]+(\s\w+)?)?(|)?)(]*>)', re.IGNORECASE) diff --git a/src/calibre/gui2/actions/similar_books.py b/src/calibre/gui2/actions/similar_books.py index af350835a9..c36eb4915b 100644 --- a/src/calibre/gui2/actions/similar_books.py +++ b/src/calibre/gui2/actions/similar_books.py @@ -21,7 +21,8 @@ class SimilarBooksAction(InterfaceAction): m = QMenu(self.gui) for text, icon, target, shortcut in [ (_('Books by same author'), 'user_profile.svg', 'authors', _('Alt+A')), - (_('Books in this series'), 'books_in_series.svg', 'series', _('Alt+S')), + (_('Books in this series'), 'books_in_series.svg', 'series', + _('Alt+Shift+S')), (_('Books by this publisher'), 'publisher.png', 'publisher', _('Alt+P')), (_('Books with the same tags'), 'tags.svg', 'tag', _('Alt+T')),]: ac = self.create_action(spec=(text, icon, None, shortcut), diff --git a/src/calibre/web/feeds/templates.py b/src/calibre/web/feeds/templates.py index eb31b541e8..e23b8dda1b 100644 --- a/src/calibre/web/feeds/templates.py +++ b/src/calibre/web/feeds/templates.py @@ -195,7 +195,8 @@ class NavBarTemplate(Template): if bottom: navbar.append(HR()) text = 'This article was downloaded by ' - p = PT(text, STRONG(__appname__), A(url, href=url), style='text-align:left') + p = PT(text, STRONG(__appname__), A(url, href=url), + style='text-align:left; max-width: 100%; overflow: hidden;') p[0].tail = ' from ' navbar.append(p) navbar.append(BR())