{"id":19572357,"url":"https://github.com/linjunpop/weixin_js_sdk","last_synced_at":"2025-04-27T03:33:01.073Z","repository":{"id":26405548,"uuid":"29855503","full_name":"linjunpop/weixin_js_sdk","owner":"linjunpop","description":"a Weixin(Wechat) JS-SDK Toolkit.","archived":false,"fork":false,"pushed_at":"2015-12-16T08:43:32.000Z","size":179,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T22:49:43.246Z","etag":null,"topics":["wechat","weixin"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linjunpop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-26T10:07:28.000Z","updated_at":"2018-09-08T05:20:20.000Z","dependencies_parsed_at":"2022-08-21T02:20:22.260Z","dependency_job_id":null,"html_url":"https://github.com/linjunpop/weixin_js_sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fweixin_js_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fweixin_js_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fweixin_js_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fweixin_js_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linjunpop","download_url":"https://codeload.github.com/linjunpop/weixin_js_sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085144,"owners_count":21533821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["wechat","weixin"],"created_at":"2024-11-11T06:26:02.878Z","updated_at":"2025-04-27T03:32:58.239Z","avatar_url":"https://github.com/linjunpop.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeixinJsSdk\n\n[![Code Climate](http://img.shields.io/codeclimate/github/linjunpop/weixin_js_sdk.svg)](https://codeclimate.com/github/linjunpop/weixin_js_sdk)\n[![Gem Version](http://img.shields.io/gem/v/weixin_js_sdk.svg)](https://rubygems.org/gems/weixin_js_sdk)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://linjunpop.mit-license.org)\n\na Weixin [JS-SDK](http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html) toolkit.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'weixin_js_sdk'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install weixin_js_sdk\n\n## Usage\n\n* Fetch Access Token\n\n```ruby\naccess_token = WeixinJsSDK::AccessToken.new(\n  app_id: ENV['WEIXIN_APP_ID'],\n  app_secret: ENV['WEIXIN_APP_SECRET']\n)\n#=\u003e #\u003cWeixinJsSDK::AccessToken:0x007ff9c488a111\u003e\naccess_token.token\n#=\u003e xxx\naccess_token.expires_in\n#=\u003e 7200\n```\n\n* Fetch Ticket\n\n```ruby\nticket = WeixinJsSDK::Ticket.new(access_token: access_token.token)\n#=\u003e #\u003cWeixinJsSDK::Ticket:0x007fe62d133c68\u003e\nticket.token\n#=\u003e xxx\nticket.expires_in\n#=\u003e 7200\n```\n\n* Generate Signature\n\n```ruby\nsignature = WeixinJsSDK::Signature.new(\n  ticket: ticket.token,\n  nonce_str: 'Wm3WZYTPz0wzccnW',\n  timestamp: '1414587457',\n  url: 'http://mp.weixin.qq.com'\n).sign\n#=\u003e f4d90daf4b3bca3078ab155816175ba34c443a7b\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/[my-github-username]/weixin_js_sdk/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinjunpop%2Fweixin_js_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinjunpop%2Fweixin_js_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinjunpop%2Fweixin_js_sdk/lists"}