Skip to content

Instantly share code, notes, and snippets.

@matsubo
Created November 2, 2013 03:40
Show Gist options
  • Save matsubo/7275248 to your computer and use it in GitHub Desktop.
Save matsubo/7275248 to your computer and use it in GitHub Desktop.
<?php
require __DIR__ . '/../vendor/autoload.php';
use DMM\Affiliate;
$dmm = new Affiliate('HnewL5HcLPsefmeUpzL0', 'pornjapan-990');
$dmm->setKeyword('スク水');
$array = $dmm->getResult();
foreach ($array->result->items->item as $item) {
$title = $item->title;
$affiliate_url = $item->affiliateURL;
if (!isset($item->sampleImageURL->sample_s)) {
continue;
}
$image_url = $item->sampleImageURL->sample_s->image[7];
print sprintf('<li><a href="%s" title="%s" target="dmm"><img alt="%s" src="%s"></a></li>', $affiliate_url, $title, $title, $image_url);
print "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment