{"id":20298976,"url":"https://github.com/dofy/as3-douban-api","last_synced_at":"2026-03-06T16:01:38.487Z","repository":{"id":5921143,"uuid":"7140741","full_name":"dofy/as3-douban-api","owner":"dofy","description":"Douban API (V2) for as3","archived":false,"fork":false,"pushed_at":"2012-12-14T19:00:26.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T06:13:46.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dofy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-13T01:22:05.000Z","updated_at":"2021-04-28T10:47:56.000Z","dependencies_parsed_at":"2022-09-06T04:41:32.844Z","dependency_job_id":null,"html_url":"https://github.com/dofy/as3-douban-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dofy/as3-douban-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fas3-douban-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fas3-douban-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fas3-douban-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fas3-douban-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dofy","download_url":"https://codeload.github.com/dofy/as3-douban-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofy%2Fas3-douban-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30184874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T16:13:00.264Z","updated_at":"2026-03-06T16:01:38.440Z","avatar_url":"https://github.com/dofy.png","language":"ActionScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Douban API (V2) for as3(Air)\n============================\n\n豆瓣 API (v2) for as3(Air) *注意,目前只能正常用于 Air 程序中*\n\n目前已完成的 API:\n-----------------\n* OAuth2\n* 用户\n* 豆邮\n\n示例代码:\n---------\n    public class Test extends Sprite\n    {\n        \n        public function Test()\n        {\n            AppConfig.baseURL = 'https://api.douban.com';\n            \n            AppConfig.apiKey = 'your api key';\n            AppConfig.secret = 'your secret';\n            \n            AppConfig.redirectUri = 'http://your.site.com/callback';\n            \n            // 这个 access token 用来做测试的, 正常情况下应该在得到 access_token 后保存到客户端文件中\n            AppConfig.accessToken = 'test access token';\n            \n            // 定义一个 User Api 对象\n            var user:User = new User();\n            // 绑定事件 (只有这两个事件)\n            user.addEventListener(ApiEvent.SUCCESS, succHandler);\n            user.addEventListener(ApiEvent.FAILED, failHandler);\n            \n            // 获取当前授权用户信息\n            user.me();\n            // 获取某用户信息\n            //user.user('dofy');\n            // 搜索用户\n            //user.search('dofy');\n            \n            // OAuth2\n            var oauth:OAuth2 = new OAuth2('https://www.douban.com');\n            oauth.addEventListener(ApiEvent.SUCCESS, succHandler);\n            oauth.addEventListener(ApiEvent.FAILED, failHandler);\n            // auth 方法会弹出页面, 重定向到 redirectUri, 地址中包含 code\n            //oauth.auth(AppConfig.apiKey, AppConfig.redirectUri, OAuth2.CODE);\n            // 用上一步拿到的 code 获取 access_token\n            //oauth.accessToken(AppConfig.apiKey, AppConfig.secret, AppConfig.redirectUri, 'auth code');\n            \n        }\n        \n        private function succHandler(e:ApiEvent):void \n        {\n            // ApiEvent 事件中除了包含返回的数据外, \n            // 还会包含对应请求的 方法,Http 状态码 和 请求地址\n            // 返回数据中会附加 request(即使是正确的返回) 和 http_status 属性\n            trace('success handler:', e, JSON.stringify(e.data));\n            switch(e.url)\n            {\n                case '/v2/user/~me':\n                    // 格式化成数据对象\n                    var userVO:UserVO = new UserVO(e.data);\n                    trace('user created', userVO.created.toLocaleString());\n                    break;\n            }\n        }\n        \n        private function failHandler(e:ApiEvent):void \n        {\n            trace('failed handler:', e, JSON.stringify(e.data));\n        }\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofy%2Fas3-douban-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdofy%2Fas3-douban-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofy%2Fas3-douban-api/lists"}