background: Since the second half of this year contacted a mobile app project based on Reactjs. began to understand the corodva of this magical thing. The following self also made a few small apps put on the app Bao. August began to want to do a blog park app. So on the private chat blog Park team to apply for the blog Park API access (of course, in fact, the app Bao also has a blog Park app. And grabbed it with fiddler. The Discovery API is also perfect. Telling the truth is much better than the API provided by the blog Park team. I think it's the developer crawling the page and parsing it yourself. )
The first step: Application API:
Private Chat Blog Park, get OAuth ClientID and Clientserect.
Step Two: Call the API:
Never used OAuth2.0 before, and then OAuth2.0 the knowledge of the evil. This is not a detailed overview. Let's see how to get rid of the API. The tool I chose is postman (self-feeling a nice chrome extension) and of course it needs to be FQ.
Below is a link to test the news. Type Select OAuth2.0
The OAuth2.0 token address of the blog Park is the Https://api.cnblogs.com/token address. The token and expiretime are returned and then clicked on Usertoken to access it.
Step Three: Technology selection
This project is just as a personal amateur exercise, want to learn about ANGULAR2, plus ionic is a good framework. And also came out of the beta version of Ionic2. (Ionic is the best H5 app framework to work with angular so far, personally.) So decisively choose Ionic2 to develop. I like Ionic2 's style, too.
Fourth Step: development phase
Development is the use of this month's spare time, although the API is very early application. There are other projects in front of the company that have not had time to do. Just this month, I finished the first edition of this little app in my spare time at work.
Here omit a big wave of bad code (because the early on ANGULAR2, the code structure is very messy.)
Fifth: Product display:
Function points: 1. Support for news and blog queries. Support Sharing, commenting. Click on the avatar to go to the blogger space to view the blog post
Sixth: The pits encountered
1. Ionic2 unfamiliar, Angular2 unfamiliar, need to spend time to see the API
2. Formerly in the United States, an egg e-commerce Chengdu Branch to work mainly to do. NET backend system to do much. Although now in some sea Amoy small company engaged in front-end. JS is still relatively self-confidence (because the feeling and C # no difference, especially the current typescript). But for a man who does not love painting. Even PS is not, CSS is too poor (because now the company has a special writing HTML and CSS UI sister paper). Some places still need to use CSS such as the List of tab is written by themselves. Although it only takes more than 10 lines of CSS, it still takes a lot of time. Include logo or get rid of UI girl flowers a few minutes to get some (but I guess I have to make a long time)
3. Not familiar with OAuth, it took some time to get to know OAuth.
4. Local Development browser localhost service spanning debugging is inconvenient. For the blog park's non-login API browser, the localhost setting agent is capable of resolving cross-issues. However, for login. For example, the comment function is stuck for a long time. After the login API is called. Returns the log-in cookie after the True,response header is returned. However, when invoking the comment interface, the cookie inside the header is lost, and then the blog Park server returns a prompt message (the user is not logged in). But it's normal to pack the app on the phone. Personally, it is because the login and comment API is not a base address. When I visited localhost, I set up two proxies for my browser.
Seventh: summary
With one months of spare time to make such a small thing. Code I am in the groove, there are really a lot of problems. Later, you will consider doing a cnode client again. Look at the API provided by Cnode, relatively more reasonable than the blog park. The project structure will be well designed. Let's do the code sharing.
Https://github.com/FourLeafClover/CNBlogApp
Due to copyright issues, the app on the shelves prompted me to infringe. Although I have to apply for Blog Park chat Records sent to the customer service or not. So I'll put the post-packaged app on GitHub. The home desktop has no development environment. By tomorrow, the company is putting apps on GitHub. (Not much to say.) Watch TV and then wash and sleep. )
Here is a recommendation to give RN (React native) Blog Park app, really good. The UI and smoothness are good. Forget who the Bo friend did. Just inadvertently in a blog comment inside see is a Bo friends do.
Http://sj.qq.com/myapp/detail.htm?apkName=com.google.android.apps.blogger
Blog Park app based on Corova