Pastoid

Convert Flickr username to nsid

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

This paste was last updated on June 11, 2009 at 9:27 pm.

Pasted Coderaw

function confirm_nsid($username)
{
	if(!preg_match('%\d+@N\d{2}%', $username)) {
		$url = 'http://api.flickr.com/services/rest/?method=flickr.people.findByUsername&format=rest&api_key=39b1bcf1b0c84a24435677252085d436&format=php_serial&username=' . urlencode($username)
		$result = RemoteRequest::get_contents($url);
		if($result = unserialize($result)) {
			if(isset($result['user']['nsid'])) {
				$username = $result['user']['nsid'];
			}
		}
	}
	return $username;
}
 
 

Toggle wordwrap

Referring DomainHits
Unknown Referer 127
pastoid.com 17
www.google.be 2
search.live.com 1
Is this paste spam?
<Hide