Giter Site home page Giter Site logo

hugo-astier / twitter-github-apis-node.js Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 686 KB

[Feel free to adopt/fork this repo] Example of creating an API consuming Twitter & Github APIs with Sails.js (Node.js)

License: MIT License

JavaScript 96.84% HTML 3.16%

twitter-github-apis-node.js's Introduction

Twitter-GithubAPIs

  • The following commands must be run in Twitter-GithubAPIs directory.
  • Node.js version >= 8.0.0 has to be installed on your system.

Start application

1. Remove local.js from the Git index

git rm --cached config/local.js

2. Install global npm packages & dependencies

npm install -g sails
npm install

3. Set the Twitter API keys

4. Run application

sails lift

Usage

All commands are run from the browser's console. Open http://localhost:1337 and open the console:

  • Chrome: Press Ctrl+Shift+J (Windows / Linux) or Cmd+Opt+J (Mac)
  • Firefox: Press Ctrl+Shift+K (Windows / Linux) or Cmd+dOpt+K (Mac)

Commands

Github

gitSearchRepo(searchQuery[, sort, order])

Find repositories via various criteria. Parameters: https://developer.github.com/v3/search/#search-repositories

gitSearchUser(searchQuery[, sort, order])

Find users via various criteria. Parameters: https://developer.github.com/v3/search/#search-users

gitCreateRepo(token, name[, description, homepage, privateBool])

Create a repository. Parameters:

  • token: Required. Your personal Github access token (https://github.com/settings/tokens). Make sure when creating or editing your token to check these checkboxes:
    • repo
    • user
    • delete_repo
  • name: Required. The name of the repository.
  • description: A short description of the repository.
  • homepage: A URL with more information about the repository.
  • privateBool: Either true to create a private repository or false to create a public one. Creating private repositories requires a paid GitHub account. Default: false.
gitDeleteRepo(token, name)

Delete a repository. Parameters:

  • token: Required. Your personal Github access token (https://github.com/settings/tokens). Make sure when creating or editing your token to check these checkboxes:
    • repo
    • user
    • delete_repo
  • name: Required. The name of the repository.

Twitter

twAuth()

Authenticate. All Twitter commands need authentication, as well as gimmeTheDude(). Once authenticated, your authentication token will be stored in sessions, which means it would have to be regenerated when restarting the app, or cleaning your cookies.

twUsername()

Get your Twitter username.

twSearchTweet(searchQuery)

Returns a collection of relevant Tweets matching a specified query. Parameters:

Lebowsky special command

gimmeTheDude()

Search for "The Dude" projects on GitHub, then, for each project, search for any tweets mentioning it. Output the Github summary of each project together with a list of recent tweets. Important: twAuth() needs to be run before.

Dev

Run npm run dev to get started. This will check if your code pass the linter, lift the app and watch the files to reload the app automatically when change occurs. More options of scripts are available, check package.json -> scripts.

twitter-github-apis-node.js's People

Watchers

James Cloos avatar Clodonog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.