Code Monkey home page Code Monkey logo

juejinxiaocetomobi's Introduction

将你的掘金小册装进kindle

  1. 下载掘金小册保存为MarkDown的格式
  2. 下载掘金小册保存为mobi格式

注意:转成mobi用的是这个项目,只支持一级目录和二级目录,导致目前mobi格式比较乱,里面的图片没有处理,如果你有好用的转mobi的工具或者代码,一定提issue告诉我,或者直接contribute.

使用方法

  • 从掘金小册的站点获取client_id,uid,token等信息,填入./config/config.json中
  • go run main.go
  • 对于没有Go环境的小伙伴,在tool文件夹中已经编译好了Linux&Mac版本的可执行文件,(在跟main.go同一目录下,因为要读取config)./juejinxiaoceToolForLinux或者./juejinxiaoceToolForMac即可
  • 等待你的小册出炉🍺

小白操作步骤

  1. 登录掘金网站,打开你的一本小册,如下图:

  1. windows按F12,Mac使用快捷键conmand+shift+i,进入开发者工具,如下图:

  1. 选择XHR(意思是过滤Ajax的异步请求),刷新一下网页,找到get?uid=xxx,上图中红色圈出部分。点击get?uid=xxx部分,可以看到该API的请求与返回等信息,其实就是我们需要的uid,id,token等,如下图所示:

  1. 可以点击response查看该API的返回信息,对于golang来说也是构造结构体的关键,具体可查看代码;
  2. 通过这个API我们可以获取sectionId的一个数组,每一个sectionId就对应文章中的一节,在第filter中搜索getListSection,该API就是获取指定sectionId的内容;

上面所用的URL我都放到了config/config.json里面,可以直接使用。

以上是基本操作,搞定之后,就执行go run main.go等待你的小册出炉🍺。

可以看到MarkDown格式和mobi格式的书籍都已经下载。

juejinxiaocetomobi's People

Contributors

hantmac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

juejinxiaocetomobi's Issues

cannot find package

这个是为什么啊? 请帮助我一下

widows10 + go最新稳定版

D:\Documents_Go\juejinxiaoceToMobi-master>go run main.go
main.go:3:8: cannot find package "github.com/hantmac/juejinxiaoceToMobi/processData" in any of:
F:\Go\src\github.com\hantmac\juejinxiaoceToMobi\processData (from $GOROOT)
D:\Documents_Go\src\github.com\hantmac\juejinxiaoceToMobi\processData (from $GOPATH)

D:\Documents_Go\juejinxiaoceToMobi-master>

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.