• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JohnnyTheTank/angular-github-api-factory: AngularJS Factory for GitHub v3 JSON R ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

JohnnyTheTank/angular-github-api-factory

开源软件地址:

https://github.com/JohnnyTheTank/angular-github-api-factory

开源编程语言:

JavaScript 100.0%

开源软件介绍:

angular-github-api-factory is an angularjs module with a github api factory.

npm version Bower version

Author: Jonathan Hornung (JohnnyTheTank)

Usage

  1. Install via either bower, npm or downloaded files:

    1. bower install --save angular-github-api-factory
    2. npm install --save angular-github-api-factory
    3. download angular-github-api-factory.zip
  2. Include dependencies in your HTML.

    1. When using bower:
    <script src="bower_components/angular-github-api-factory/dist/angular-github-api-factory.min.js"></script>
    1. When using npm:
    <script src="node_modules/angular-github-api-factory/dist/angular-github-api-factory.min.js"></script>
    1. when using downloaded files
    <script src="angular-github-api-factory.min.js"></script>
  3. Add jtt_github to your application's module dependencies.

  4. Use the factory githubFactory

factory methods

getUser

githubFactory.getUser({
    user:"<USERNAME_NAME>",
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});

getUsers

// https://developer.github.com/v3/search/#search-users
githubFactory.getUsers({
    q:"<SEARCH_STRING>",  // (optional)
    sort:"<SORT_STRING>", // (optional) 'followers', 'repositories', 'joined'
    order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
    per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});

getRepo

githubFactory.getRepoByUserAndName({
    user:"<USER_NAME>",
    repo:"<REPO_NAME>",
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});

getRepos

// https://developer.github.com/v3/search/#search-repositories
githubFactory.getReposByName({
    q:"<SEARCH_STRING>",
    sort:"<SORT_STRING>", // (optional) 'stars', 'forks', or 'updated'
    order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
    per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});
githubFactory.getReposByUser({
    user:"<USER_NAME>",
    q:"<SEARCH_STRING>", // (optional)
    sort:"<SORT_STRING>", // (optional) 'stars', 'forks', or 'updated'
    order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
    per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});

getEvents

githubFactory.getEventsFromRepoByUserAndName({
    user:"<USER_NAME>",
    repo:"<REPO_NAME>",
    q:"<SEARCH_STRING>",  // (optional)
    sort:"<SORT_STRING>", // (optional)
    order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
    per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});
githubFactory.getEventsByUser({
    user:"<USER_NAME>",
    q:"<SEARCH_STRING>", // (optional)
    sort:"<SORT_STRING>", // (optional)
    order:"<SORT_ORDER>", // (optional) 'desc', 'asc'
    per_page:"<ITEMS_PER_PAGE>", // (optional) valid values: 1-100 | default: 30
    access_token:"<ACCESS_TOKEN>" // (optional)
}).then(function(_data){
    //on success
}).catch(function (_data) {
    //on error
});

Github JSON API

More angular-api-factories

bandsintown - dailymotion - facebook - footballdata - flickr - github - openweathermap - tumblr - vimeo - wikipedia - youtube

License

MIT




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap