Created
April 12, 2011 19:53
-
-
Save JeffreyWay/916246 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
<?php | |
class envato_marketplace { | |
public static $base_url = 'http://marketplace.envato.com/api/edge/'; | |
public function curl($path) { | |
$ch = curl_init(self::$base_url . $path); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return json_decode($data); | |
} | |
} | |
$data = envato_marketplace::curl('new-files-from-user:JeffreyWay,tutorials.json'); | |
$data = $data->{'new-files-from-user'}; | |
include 'index.tmpl.php'; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>untitled</title> | |
</head> | |
<body> | |
<?php foreach($data as $item) : ?> | |
<h2> | |
<a href="<?php echo $item->url; ?>"> | |
<?php echo $item->item; ?> | |
</a> | |
<span> <?php echo $item->sales; ?> </span> | |
</h2> | |
<img src="<?php echo $item->live_preview_url;?>" alt="<?php echo $item->item; ?>" /> | |
<?php endforeach; ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment