Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init('fundrazr.com/api/campaigns/3HjO2/activities?cb=1333406687429');
- curl_setopt($ch, CURLOPT_PORT, 80);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $curl = curl_exec($ch);
- curl_close($ch);
- $xml = simplexml_load_string($curl);
- foreach ($xml->entries->children() as $baby) {
- $amount = 'no';
- $msg = '';
- $name = '';
- foreach ($baby as $child) {
- if ($child->getName() == 'isAnonymous' && $child == 'true') { $name = 'Anonymous'; }
- if ($child->getName() == 'amount') { $amount = $child; }
- if ($child->getName() == 'activityId') { $idd = $child; }
- if ($child->getName() == 'message') {
- $msg = $child;
- $msg = str_replace("\n", "", $msg);
- $msg = str_replace("\r", "", $msg);
- $msg = trim($msg);
- }
- if ($child->getName() == 'showAmount' && $child == 'false') { $amount = 'Unknown Amount'; }
- if ($child->getName() == 'owner') {
- foreach ($child as $teen) {
- if ($teen->getName() == 'name') { $name = $teen; }
- }
- }
- }
- if ($amount != 'no') { echo $idd . '~ New Donation: ' . $amount . ' by ' . $name . ' ~ ' . $msg . "\n"; }
- }
- ?>
Add Comment
Please, Sign In to add comment