Category : json

I have a problem with the code below. It only works if $krypto = "LTC", "BTC" or "DASH". If the $krypto = "ETH" or "DOGE" page does not work and throws the server error 500. Anyone have any ideas? if ($krypto == "BTC") { $json = file_get_contents(‘https://api.blockcypher.com/v1/btc/main/addrs/1BSJxTKxu2RZfHCtEFpXShypn73Xmpry6N/balance’); } if ($krypto == "LTC") { $json = ..

Read more

This code grabs all the steam IDs of a certain steam user’s friends. Then it splits them into arrays with 100 elements (each element containing a steam ID), because we can only pass GetPlayerSummaries 100 steam IDs at a time. But when I try to output some data, it only outputs data from 100 friends. ..

Read more

Here is what is going on. I have an error in my Ajax code that is causing the following error: Unexpected end of JSON input ajax Here is my code: I’m getting data from an array by doing the following: echo json_encode($departTickets); Then I’m parsing the JSON by doing the following: $("[data-department-id]").click(function() { id = ..

Read more

I’m having trouble reading/understanding Clarifai’s API query results. Below is my curl query via php. Everything seems to work but the results I get (see example below) don’t correspond with the results when testing on their website. On the website model prediction values range from 0.0 to 1.0 (the closer to 1.0 it is the ..

Read more

I’m trying to create an array of amazon product variants using DOM php, My desired array should look like; ["Variant Name":"ASIN number"] Here is my code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ‘https://www.amazon.co.uk/dp/B08LZHMQXS?psc=1’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘GET’); $html = curl_exec($ch) curl_close($ch); $dom = new DomDocument(); $dom->loadHTML($html); $dom_xpath = new DOMXpath($dom); $variants = $dom_xpath->query(‘//*[@class="swatchAvailable" or ..

Read more

I’ve created contact form that send form data to an email then I’m sending ajax to the server which returns json response with success message or alert message but I’m getting the data commented as below : <!– TESS –> // {"type":"success","message":"Contact form successfully submitted. Thank you, I will get back to you soon!"} this ..

Read more