Created
April 15, 2010 13:18
-
-
Save udonchan/367074 to your computer and use it in GitHub Desktop.
ura86 日記の背景用.udonchan のtumblr 先頭1000件の画像からランダムで表示
This file contains hidden or 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 | |
$ci = curl_init('http://udonchan.tumblr.com/api/read/json?num=1&type=photo&start='. mt_rand(0,1000)); | |
curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); | |
$value = json_decode(str_replace(";","",str_replace("var tumblr_api_read = ","",curl_exec($ci))), true); | |
header("Location: " . $value["posts"][0]["photo-url-400"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment