Last active
April 18, 2017 23:37
-
-
Save jsmithdev/721b95b1c21845dbb31401c23738c8ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const port = process.env.PORT || 8080 | |
const request = require('request') | |
//Be sure to change YOURAPPNAME | |
let keywordUrl = "http://svcs.ebay.com/services/search/FindingService/v1"; | |
keywordUrl += "?OPERATION-NAME=findItemsByKeywords"; | |
keywordUrl += "&SERVICE-VERSION=1.0.0"; | |
keywordUrl += "&SECURITY-APPNAME=YOURAPPNAME"; | |
keywordUrl += "&GLOBAL-ID=EBAY-US"; | |
keywordUrl += "&RESPONSE-DATA-FORMAT=JSON"; | |
//keywordUrl += "&callback=hurray"; | |
keywordUrl += "&REST-PAYLOAD"; | |
keywordUrl += "&keywords=android%20device"; | |
keywordUrl += "&paginationInput.entriesPerPage=3"; | |
request(keywordUrl, (e, r, b) => e ? error(e) : hurray(r, b)) | |
function hurray(r, b){ | |
JSON.parse(b).findItemsByKeywordsResponse[0].searchResult[0].item | |
.forEach(item => console.log(r.statusCode, item.title.toString())) | |
} | |
function error(e){ | |
console.log('Error: ', e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment