我决定编写一个应用程序,如: http: //michaelgrinich.com/hackernews/但对于 Android 设备,我的想法将使用 Web 应用程序后端(因为我宁愿在 Python 和 Web 中编写代码,而不是在 Android 设备上完全使用 Java) .
我现在实现的是这样的:
$ curl -i http://localhost:8080/stories.json?page=1\&stories=1
HTTP/1.0 200 OK
Date: Sun, 25 Apr 2010 07:59:37 GMT
Server: WSGIServer/0.1 Python/2.6.5
Content-Length: 296
Content-Type: application/json
[{"title": "Don\u2019t talk to aliens, warns Stephen Hawking", "url": "http://www.timesonline.co.uk/tol/news/science/space/article7107207.ece?", "unix_time": 1272175177, "comments": 15, "score": 38, "user": "chaostheory", "position": 1, "human_time": "Sun Apr 25 01:59:37 2010", "id": "1292241"}]
下一步(我认为也是最后一步)是投票,我的设计是这样的:
$ curl -i http://localhost:8080/stories/1 -d "vote=up" -u username:password
将投票并:
$ curl -i http://localhost:8080/stories/1 -d "vote=down" -u username:password
投反对票。
我不知道该怎么做......我打算使用斜纹但登录链接总是不同的,例如:
http://news.ycombinator.com/x?fnid=7u89ccHKln
稍后,Android 应用程序将使用此 API。
有以编程方式浏览 Hacker News 的经验吗?