Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add links to a list of whats trending from the Foursquare API using PHP
    primarykey
    data
    text
    <p>Hi so I have created a list of the trending places in a given area using the Foursquare API: see the following link <a href="http://createmate.co/foursquare-whatshot/" rel="nofollow">http://createmate.co/foursquare-whatshot/</a></p> <p>I am trying to figure out how to make each item link to its respective Foursquare URL. Here is the code so far... </p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Foursquare What's Hot&lt;/title&gt; &lt;!-- external CSS link --&gt; &lt;link rel="stylesheet" href="css/normalize.css"&gt; &lt;link rel="stylesheet" href="css/style.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container"&gt; &lt;h1&gt;Foursquare What's Hot&lt;/h1&gt; &lt;?php /* GET THE DATA */ $trending_url = file_get_contents("https://api.foursquare.com/v2/venues/trending?ll=40.7,-74&amp;oauth_token=BQEPEMYIFHHH2C1OGBTJDI4GBYV5HQAPNFLR5ON1JIAI42GN&amp;v=20130220"); $trending_output = json_decode($trending_url); /* TEST THE DATA */ //echo "&lt;pre&gt;"; //print_r($trending_output); //echo "&lt;/pre&gt;"; /* PRINT RESULTS */ for ($i=0;$i&lt;10;$i++) { echo "&lt;ul id ='locations'&gt;"; echo "&lt;li&gt; &lt;a href= " . $trending_output-&gt;response-&gt;venues[$i]-&gt;canonicalURL . "&gt; &lt;h3&gt;" . $trending_output-&gt;response-&gt;venues[$i]-&gt;name . "&lt;br&gt;"; echo "&lt;li&gt; &lt;h4&gt;" . $trending_output-&gt;response-&gt;venues[$i]-&gt;location-&gt;address . "&lt;br&gt;"; echo "&lt;/ul&gt;"; } ?&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p></p> <p>Any help is much appreciated.</p> <p>Adam</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload