Skip to content

Instantly share code, notes, and snippets.

@luizcanet
Last active December 30, 2017 20:23
Show Gist options
  • Save luizcanet/e26acfcea93dec2b9be9 to your computer and use it in GitHub Desktop.
Save luizcanet/e26acfcea93dec2b9be9 to your computer and use it in GitHub Desktop.
Portifolio from Behance
<?php
$get = 'http://www.behance.net/v2/users/luizcanet/projects?api_key=4p1K31fR0mB3h4Nc3Th1Sd0NtW0rKs';
$portifolio = json_decode(file_get_contents($get));
?>
<?php if ($portifolio->http_code = 200) : ?>
<?php foreach ($portifolio->projects as $project) : ?>
<article class="project">
<a href="<?php print $project->url; ?>" target="_blank">
<h1><?php print $project->name; ?></h1>
<img src="<?php print $project->covers->{404}; ?>" alt="Project Image" />
<div class="stats">
<span class="appreciations"><?php print $project->stats->appreciations; ?></span>
<span class="views"><?php print $project->stats->views; ?></span>
</div>
</a>
</article>
<?php endforeach; ?>
<?php else : ?>
<p><?php print $portifolio->http_code; ?></p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment