Socket
Socket
Sign inDemoInstall

angular-github-api-factory

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-github-api-factory

angularjs factory for github json rest api requests


Version published
Weekly downloads
0
Maintainers
1
Install size
2.02 MB
Created
Weekly downloads
 

Readme

Source

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
});
//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

Keywords

FAQs

Last updated on 30 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc