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.
"Untitled" 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
/* TUMBLR RSS PARSE DOCUMENT */ 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 '<h3>'.date('M j', $date).'</h3>'; switch ($type): case 'regular': echo '<h4>'.$post->{'regular-title'}.'</h4> '.$post->{'regular-body'}; break; case 'photo': if(substr($post->{'photo-caption'}, 0, 3) == '<p>') $caption = $post->{'photo-caption'}; else $caption = '<p>'.$post->{'photo-caption'}.'</p>'; echo '<p><img src="'.$post->{'photo-url'}.'" alt="Poster Image" border="0" /></p> '.$caption; break; case 'video': echo '<p>'.$post->{'video-player'}.'</p> <p>'.$post->{'video-caption'}.'</p>'; break; case 'link': echo '<h4><a href='.$post->{'link-url'}.'>'.$post->{'link-text'}.'</a></h4> <p>'.$post->{'link-description'}.'</p>'; break; default; echo 'Article not supported.'; break; endswitch; } } } |