本博客使用Google进行本站搜索,更快更准确:
读取中...

CSSmania的API

October 4, 2008 · Filed Under CSS 

HTTP method & 编码问题

CSSmania的API只支持 GET method 和 UTF-8 的编码。

速率限制 & 时间戳

目前还没有任何速度的限制,但是如果滥用API的话,服务器可能会被永久屏蔽。

时间格式为:YYYY-MM-DD HH:mm:ss

API Key & 格式

不需要API Key(如果不需要使用CSSmania截图的话),如果需要截图,请联系官方

目前返回的格式为JSON。

使用API

格式:http://cssmania.com/api/api.php?search=xxxxxxxxxxxxx
搜索的参数最少是7个字符。
得到的数据是JSON格式,如下:

[{"id":"5865","url":"http:\/\/www.authenticjobs.com\/",
"developed":"Cameron Moll",
"developed_url":"http:\/\/www.cameronmoll.com\/","country":"U.S",
"rating":"5","totalscore":"104",
"numbervotes":"20",
 "colours_0":"f0f0e0",
"colours_1":"e0e0e0","colours_2":602000,
"colours_3":600000,"colours_4":"f0e0e0", 
"url_screenshot":"http:\/\/cssmania.com\/screenshots\/authenticjobscom.jpg",
"time_created":"2006-09-28 14:05:38", 
"last_screenshot_version":"2006-09-28 14:14:22"},{"id":"9979",
"url":"http:\/\/www.authenticstyle.co.uk\/",
"developed":"William Smith",
"developed_url":"http:\/\/www.authenticstyle.co.uk\/",
"country":"United Kingdom","rating":"6","totalscore":"56",
"numbervotes":"9","colours_0":202000,
"colours_1":200000,"colours_2":202020,"colours_3":"000000",
"colours_4":606060,
 "url_screenshot":
"http:\/\/cssmania.com\/screenshots\/authenticstylecouk_fav.jpg",
"time_created":"2008-04-20 19:20:58",
"last_screenshot_version":"2008-04-20 19:21:17"}]
其中一些参数的说明:
id = 截图ID(for未来版本)
url = 截图URL
developed = 截图开发者
country = 开发者国籍
rating = 实际打分
totalscore = 总得票数
numbervotes = 票数排名
colours_0 … 5 = 设计中使用做多的5种颜色(RGB16进制)
url_screenshot = 在CSSmania服务器上的截图
time_created = 截图的创建时间
last_screenshot_version = 最近的截图版本
HTTP状态码:

200 OK: 正常

304 Not Modified: 无新数据

400 Bad Request: 请求没有经过验证

404 Not Found: 找不到资源

500 Internal Server Error: CSSmania服务器出错

503 Service Unavailable: CSSMania服务器忙,稍后再试。

Comments

2 Responses to “CSSmania的API”

  1. CSSmania开放API 听者有心 on October 4th, 2008 8:57 pm

    [...] 下面一篇文章,我会翻译CSSmania API 的一些接口知识。 [...]

  2. red3 on November 16th, 2008 12:56 pm

    正好对我有用,过一踩二脚

Leave a Reply