Skip to content

Instantly share code, notes, and snippets.

@hirobert
Created March 16, 2023 22:55
Show Gist options
  • Save hirobert/948c2082ff198e0b3458857aabeaff54 to your computer and use it in GitHub Desktop.
Save hirobert/948c2082ff198e0b3458857aabeaff54 to your computer and use it in GitHub Desktop.

Revisions

  1. hirobert created this gist Mar 16, 2023.
    25 changes: 25 additions & 0 deletions noun-project-api-v2.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    var OAuth = require('oauth')
    // `npm install oauth` to satisfy
    // website: https://github.com/ciaranj/node-oauth

    var KEY = "<INSERT KEY HERE>"
    var SECRET = "<INSERT SECRET HERE>"

    var oauth = new OAuth.OAuth(
    'http://api.thenounproject.com',
    'http://api.thenounproject.com',
    KEY,
    SECRET,
    '1.0',
    null,
    'HMAC-SHA1'
    )
    oauth.get(
    'http://api.thenounproject.com/v2/icon/6324',
    null,
    null,
    function (e, data, res){
    if (e) console.error(e)
    console.log(require('util').inspect(data))
    }
    )
    5 changes: 5 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    {
    "dependencies": {
    "oauth": "^0.9.12"
    }
    }