{"id":17087905,"url":"https://github.com/lian-yue/weibo-api","last_synced_at":"2026-05-18T00:04:27.975Z","repository":{"id":57014532,"uuid":"54718191","full_name":"lian-yue/weibo-api","owner":"lian-yue","description":"微博 weibo api   oauth2 sdk","archived":false,"fork":false,"pushed_at":"2016-03-27T04:39:20.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T15:38:30.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lian-yue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-25T12:47:20.000Z","updated_at":"2018-11-30T03:06:03.000Z","dependencies_parsed_at":"2022-08-22T09:40:31.762Z","dependency_job_id":null,"html_url":"https://github.com/lian-yue/weibo-api","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lian-yue/weibo-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lian-yue%2Fweibo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lian-yue%2Fweibo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lian-yue%2Fweibo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lian-yue%2Fweibo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lian-yue","download_url":"https://codeload.github.com/lian-yue/weibo-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lian-yue%2Fweibo-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: 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-10-14T13:35:21.428Z","updated_at":"2026-05-18T00:04:22.966Z","avatar_url":"https://github.com/lian-yue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Composer 安装\n\n    composer require lianyue/weibo-api\n\n\n\n# 微博 OAuth2\n\n### 申请应用\nhttp://open.weibo.com/webmaster/add\n\nClient Id\n    就是你的  **Api Key**\n\nClient Secret\n    就是你的  **App Secret**\n\n\n\n\n### OAuth2 api 列表\nhttp://open.weibo.com/wiki/%E5%BE%AE%E5%8D%9AAPI\n\n\n\n\n\n### Oauth2使用方法\n\n    namespace LianYue\\WeiboApi;\n\n    $oauth2 = new OAuth2(CLIENT_ID, CLIENT_SELECT);\n    $oauth2-\u003esetRedirectUri(CALLBACK_URI);\n    try {\n        // 设置 state\n        if (!empty($_COOKIE['weibo_api_state'])) {\n            $oauth2-\u003esetState($_COOKIE['weibo_api_state']);\n        }\n\n        // 取得令牌\n        $accessToken = $oauth2-\u003egetAccessToken();\n\n        // 访问令牌\n        print_r($accessToken);\n\n        // 用户信息\n        print_r($oauth2-\u003egetUsersShow()-\u003egetJson(true));\n\n        // 其他api调用\n        print_r($this-\u003eapi('GET', '/statuses/mentions.json')-\u003eresponse()-\u003egetJson(false));\n    } catch (WeiboApiException $e) {\n\n        // 获取重定向链接\n        $uri = $oauth2-\u003egetAuthorizeUri();\n\n        // 储存 state\n        setcookie('weibo_api_state', $oauth2-\u003egetState(), time() + 86400, '/');\n\n        // 重定向\n        header('Location: ' . $uri);\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flian-yue%2Fweibo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flian-yue%2Fweibo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flian-yue%2Fweibo-api/lists"}