Pastoid

The page you are looking at now is at this URL: http://pastoid.com/a0v

This paste was last updated on June 15, 2009 at 12:33 pm.

Pasted Coderaw

public function cache() {
		$user= User::identify();
		$twit= new Bridge();
		$count= $twit->getFollowerCount();
		$numpages = ceil($count/100.0);
		for ($i=1; $i<=$numpages;) {
			$followers= $twit->getFollowers($i);
			foreach($followers as $follower) {
				if($follower['location'] != null) {
					$url= 'http://local.yahooapis.com/MapsService/V1/geocode?appid=uGnX5KbV34EODF_qr6lEnvIJYXzOIvK1Sy6jPj5rJ43n9jnzqpKzWSei4.o_m.XfWtoV&location=';
					$geocode= new RemoteRequest($url . $follower['location']);
					$geocode->execute();
				if($geocode->executed() != false) {
					$response = $geocode->get_response_body();
					$xml = @new SimpleXMLElement( $response );
					$twit_city= (string)$xml->Result->City;
					$twit_state= (string)$xml->Result->State;
					if($twit_city != '') { $city= $twit_city . ', '; } else { $city= ''; }
					if($twit_state != '') { $state= $twit_state; } else { $state= ''; }
				}
			} else {
				$city= '';
				$state= '';
			}
				DB::query( 'INSERT INTO tim__followers ( tim_id, name, location ) VALUES ( ?, ?, ? )', array( $user->id, $follower['screen_name'], $city . $state ) );
			}
			$i++;
		}
		$user->info->cached= 1;
		$user->info->commit();
	}

Toggle wordwrap

Referring DomainHits
Unknown Referer 127
pastoid.com 12
Is this paste spam?
<Hide