PasteSite is open to the public, but with limited features. Register to be able to modify access rights, track your pastes and more...
If you prefer reading light text on a dark background to dark text on a light background, then you might want to try the dark theme.
"Re: #3576" by Adam [PHP]Actions: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
class tumblr { public function fetch_all($username,$start=0,$limit=20) { $target = 'http://'.$username.'.tumblr.com/api/read?start='.$start.'&num='.$limit; $xml = simplexml_load_file($target) or die("Feed failed to load"); foreach($xml->posts->post AS $post) { $attrs = $post->attributes(); $type = $attrs['type']; $date = trim($attrs['unix-timestamp']); echo '<h1>'.date('M j', $date).'</h1>'; switch ($type) { case 'link': echo '<a href='.$post->{'link-url'}.'>'.$post->{'link-text'}.'</a><br/><p>'.$post->{'link-description'}.'</p>'; break; case 'photo': echo '<img src="'.$post->{'photo-url'}.'" alt="Poster Image" border="0" /><br />'.$post->{'photo-caption'}; break; case 'video': echo $post->{'video-player'}.'<br />'.$post->{'video-caption'}; break; case 'regular': echo '<h3>'.$post->{'regular-title'}.'</h3><br />'.$post->{'regular-body'}; break; } } } } |