{"id":17143781,"url":"https://github.com/harttle/social-share","last_synced_at":"2025-07-27T13:09:03.389Z","repository":{"id":46098883,"uuid":"48787604","full_name":"harttle/social-share","owner":"harttle","description":"Social share widget supporting: wechat, weibo, linkedin, github, google+, rss, twitter, facebook and more.","archived":false,"fork":false,"pushed_at":"2019-04-09T03:00:08.000Z","size":94,"stargazers_count":51,"open_issues_count":0,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T00:09:57.637Z","etag":null,"topics":["facebook","icons","linkedin","rss","twitter","wechat","weibo"],"latest_commit_sha":null,"homepage":"https://harttle.land/social-share/","language":"JavaScript","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/harttle.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":"2015-12-30T07:11:58.000Z","updated_at":"2023-12-06T01:18:24.000Z","dependencies_parsed_at":"2022-07-19T03:17:16.481Z","dependency_job_id":null,"html_url":"https://github.com/harttle/social-share","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/harttle/social-share","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harttle%2Fsocial-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harttle%2Fsocial-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harttle%2Fsocial-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harttle%2Fsocial-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harttle","download_url":"https://codeload.github.com/harttle/social-share/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harttle%2Fsocial-share/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267361695,"owners_count":24074968,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["facebook","icons","linkedin","rss","twitter","wechat","weibo"],"created_at":"2024-10-14T20:42:18.514Z","updated_at":"2025-07-27T13:09:03.370Z","avatar_url":"https://github.com/harttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# social-share\n\n![demo image showing icons with different sizes](https://user-images.githubusercontent.com/4427974/55770334-839a8380-5ab6-11e9-9016-4cc1597f5a20.png)\n\nSocial share widget supporting: wechat, weibo, linkedin, github, google+, rss, twitter, facebook and more.\n\nLive Demo: http://harttle.com/social-share/\n\nDependencies: [Fontawesome][font]\n\nDownload: \u003chttps://github.com/harttle/social-share/releases\u003e\n\n## Installation\n\nImport Fontawesome:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\"\u003e\n```\n\nImport Social Share:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"social-share/dist/social-share.min.css\"\u003e\n\u003cscript src=\"social-share/dist/social-share.min.js\"\u003e\u003c/script\u003e\n```\n\n## Mininal Usage\n\n```html\n\u003cdiv id=\"share-area\"\u003e\u003c/div\u003e\n```\n\n```javascript\nvar el = document.getElementById('share-area');\nvar links = [{\n    url: 'http://harttle.com',\n    target: '_qrcode'\n}, {\n    plugin: 'github',\n    url: 'http://github.com/harttle'\n}, {\n    plugin: 'github',\n    args: {\n        id: 'harttle'\n    }\n}];\nwindow.socialShare(el, links);\n```\n\n## Full Usage\n\n```javascript\nvar links = [{\n    url: 'http://harttle.com',\n    target: '_qrcode',\n    color: '#fff',\n    background: '#b5b5b5',\n    icon: 'fa-code-fork',\n    plugin: 'github',\n    args: {\n        id\n    }\n}];\nvar options = {\n    size: 'md'\n};\nwindow.socialShare(el, links, options);\n```\n\n## Options\n\n### links.url\n\nType: `String`\n\nDefault: `location.href`\n\nThe url of this icon. Typically, `links.url` will be set to the `href` attribute\nof the corresponding anchor.\n\n### links.target\n\nType: `String`\n\nDefault: `\"\"`\n\nThis will be set to the `target` attribute of the anchor.\nAvailable targets: `\"_self\"`, `\"_parent\"`, `\"_blank\"`, `\"_top\"`, `\"_qrcode\"`\n\nIf set to `_qrcode`, the `links.url` will be opened as a qrcode image within a modal.\nIn the meanwhile, the `links.title` will be set to the QRcode modal title (default: `'Share Link'`). \n\n### links.icon\n\nType: `String`\n\nDefault: `'fa-code-fork'`\n\nThe Fontawesome icon class for the share button.\n\n### links.color\n\nType: `String`\n\nDefault: `'#fff'`\n\nThe color of the Fontawesome icon.\n\n### links.background\n\nType: `String`\n\nDefault: `'#b5b5b5'`\n\nThe background of the Fontawesome icon.\n\n### links.plugin\n\nType: `String`\n\nDefault: `undefined`\n\nThe plugin to use. Typically, a plugin is used to generage\nthe above settings, according to the arguments set by `links.args`.\n\nNote: Settings within `links` will override the settings returned by a plugin.\nFor example, `github` plugin responds with the url `//foo`, \nwhile `links.url` is set to `//bar`. The result url will be `//bar`.\n\n### links.args\n\nType: `Object`\n\nDefault: `{}`\n\nThe arguments passed to the plugin, which is specified by `links.plugin`.\n\n### options.size\n\nType: `String`\n\nDefault: `\"md\"`\n\nSize of the buttons, available values: \n\n* `\"lg\"`(large)\n* `\"md\"`(medium)\n* `\"sm\"`(small)\n* `\"xs\"`(exteme small)\n\n## Plugin List\n\n### Weibo（微博）\n\nAll args will be append to URL query string.\n\n```javascript\nvar link = {\n    plugin: 'weibo',\n    args: {\n        appid: '\u003cyour App ID\u003e',         // Default: ''\n        title: 'About Harttle',         // Default: document.title\n        url: '//harttle.com/about.html' // Default: location.href\n        source: 'http://harttle.com'    // Any other query string you need...\n    }\n};\n```\n\n\u003e `appid`是微博认证的App ID，便于微博跟踪。`title`和`url`用于微博分享内容和参考链接。\n\n### Wechat（微信）\n\n```javascript\nvar link = {\n    plugin: 'wechat'\n};\n```\n\n`wechat` plugin accept no arguments, while you can still set `links` properties:\n\n```javascript\nvar link = {\n    plugin: 'wechat',\n    url: '//yet.another.url',\n    color: 'yellow'\n};\n```\n\n### QR Code（二维码）\n\n```javascript\nvar link = {\n    plugin: 'qrcode'\n};\n```\n\nJust like `wechat` plugin, with different background and icon.\n\n### RSS\n\n```javascript\nvar link = {\n    plugin: 'rss'\n};\n```\n\n### Github\n\n```javascript\nvar link = {\n    plugin: 'github',\n    args: {\n        id: 'harttle'           // Your Github ID\n    }\n};\n```\n\n### Linkedin\n\n```javascript\nvar link = {\n    plugin: 'linkedin',\n    args: {\n        id: 'harttle'           // Your linkedin ID\n    }\n};\n```\n\n### Google Plus\n\n```javascript\nvar link = {\n    plugin: 'google-plus',\n    args: {\n        id: 'harttle'           // Your Google+ ID\n    }\n};\n```\n\n### Twitter\n\n```javascript\nvar link = {\n    plugin: 'twitter',\n    args: {\n        id: 'harttleharttle'    // Your twitter ID\n    }\n};\n```\n\n### Facebook\n\n```javascript\nvar link = {\n    plugin: 'facebook',\n    args: {\n        id: 'harttle'           // Your facebook ID\n    }\n}\n```\n\n## How to Write Plugins\n\nPlugins are used to generate a `link` Object according to the `links.args`.\nFor example, the `github` plugin:\n\n```javascript\n(function(socialShare) {\n    socialShare.plugin('github', function(args) {\n        return {\n            url: 'https://github.com/' + args.id,\n            background: '#b5b5b5',\n            icon: 'fa-github'\n        };\n    });\n})(window.socialShare);\n```\n\nTo use this plugin, simply set `plugin` to `\"github\"`, and specify the args:\n\n```js\nvar links = [{\n    plugin: 'github',\n    args: {\n        id: 'harttle'\n    }\n}];\n```\n\nWhich is equavalent to:\n\n```js\nvar links = [{\n    url: 'https://github.com/harttle',\n    background: '#b5b5b5',\n    icon: 'fa-github'\n}];\n```\n\n## Contribution Guideline\n\nIt's wellcome to make contributions by any means.\nWhile we suggest the following guide lines:\n\n1. Fork this repo.\n2. Add your plugin within `src/plugins/`.\n3. Run `grunt` to build the `dist/` files.\n4. Test your plugin in `demo/index.js`\n4. Commit and make a pull request.\n\n[font]: http://fontawesome.io/\n[jq]: http://jquery.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharttle%2Fsocial-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharttle%2Fsocial-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharttle%2Fsocial-share/lists"}