├── Mind-Hacks.mobi ├── images ├── cover.jpg └── screenshot.jpg ├── Mind Hacks - Liu Wei Peng.mobi ├── Readme.md └── Mind-Hacks.recipe /Mind-Hacks.mobi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evmn/Mind-Hacks/HEAD/Mind-Hacks.mobi -------------------------------------------------------------------------------- /images/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evmn/Mind-Hacks/HEAD/images/cover.jpg -------------------------------------------------------------------------------- /images/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evmn/Mind-Hacks/HEAD/images/screenshot.jpg -------------------------------------------------------------------------------- /Mind Hacks - Liu Wei Peng.mobi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evmn/Mind-Hacks/HEAD/Mind Hacks - Liu Wei Peng.mobi -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # 思维改变生活 2 | 3 | 蔡学镛老师曾在Twitter上说“如果重要的话要说三遍,那么重要的书为什么不读三遍呢?” 4 | 5 | 草草看完几十本书,可能还不如静下来慢慢看上一本书效果好呢。 6 | 7 | 今天把刘未鹏老师的博客全部爬了下来,做成了Kindle电子书,希望能够改变思维,改变生活。 8 | 9 | ![](images/cover.jpg) 10 | 11 | ![](images/screenshot.jpg) 12 | 13 | ## Reference 14 | 15 | [Mind Hacks](http://mindhacks.cn/) 16 | -------------------------------------------------------------------------------- /Mind-Hacks.recipe: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | from calibre.web.feeds.recipes import BasicNewsRecipe 3 | from calibre.ebooks.BeautifulSoup import BeautifulSoup 4 | from urllib2 import urlopen 5 | from datetime import datetime 6 | base_url = 'http://127.0.0.1:8000' 7 | 8 | class Mind_Hacks(BasicNewsRecipe): 9 | 10 | title = 'Mind Hacks' 11 | description = u'思维改变生活' 12 | cover_url = 'http://127.0.0.1:8000/cover.jpg' 13 | 14 | remove_tags_before = dict(name='div', attrs={'class': "style_breadcrumbs"}) 15 | remove_tags_after= dict(name='nav', attrs={'class': "post-navigation"}) 16 | remove_tags = [dict(name='nav', attrs={'class': "post-navigation"})] 17 | __author__ = 'evmn' 18 | language = 'zh_CN' 19 | timefmt = '' 20 | encoding = 'utf-8' 21 | publication_type = 'blog' 22 | 23 | # Don't Change 24 | no_stylesheets = True 25 | remove_javascript = True 26 | auto_cleanup = False 27 | 28 | resolve_internal_links = True 29 | delay = 1 30 | simultaneous_downloads = 5 31 | oldest_article = 999 32 | max_articles_per_feed = 999 33 | extra_css = 'h1{text-align:center;}' 34 | 35 | def parse_index(self): 36 | soup = self.index_to_soup("http://mindhacks.cn/archives/") 37 | archives = soup.find('ul', class_='car-list') 38 | feeds = [] 39 | desc = '' 40 | articles = [] 41 | last_year = '2017' 42 | for section in archives.findAll('a'): 43 | link = section['href'] 44 | split = link.split('/') 45 | year = split[3] 46 | date= split[4] + "-" + split[5] + " " 47 | 48 | title = section.getText() 49 | 50 | if last_year == year: 51 | articles.append({'title':title, 'url': link}) 52 | else: 53 | feeds.append((last_year, reversed(articles))) 54 | # for article in articles: 55 | # print(article) 56 | # print("") 57 | articles = [] 58 | articles.append({'title':title, 'url': link}) 59 | last_year = year 60 | 61 | feeds.append((last_year, reversed(articles))) 62 | # print(feeds) 63 | return reversed(feeds) 64 | --------------------------------------------------------------------------------