Share Coding

Tutorials, Problems, Stuffs …

Tag Archives: script

How to Build a Photobucket Album Viewer Extension of Chrome

To start building the viewer (View all Photos by one click), we should learn how to build a simple extension first.
A tutorial has already made by Google: http://code.google.com/chrome/extensions/getstarted.html
As you can see, the viewer extension’s layout is similar to the tutorial of Google.
Chrome Extension Tutorial by Google

 
Read more of this post

Advertisements

Photobucket Album Downloader on Chrome Extension

1. View all Photos of album
Photobucket Album Downloader on Chrome Extension

 
Read more of this post

Script of getting all the pictures’ URL of Photobucket’s album in jQuery

Since the PHP script needs a PHP server for compiling, a jQuery version has been made for reference.
Javascript do not support cross-domain fetching source, but some libraries did helped on those issues.

Click here for Demo

jQuery Plugin: cross-domain-ajax
https://github.com/padolsey/jQuery-Plugins/ And it is depends on jQuery: http://jquery.com/

 
1. We need to include two libraries: jQuery and cross-domain-ajax(jQuery Plugin)

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/padolsey/jQuery-Plugins/master/cross-domain-ajax/jquery.xdomainajax.js"></script>

 
Read more of this post

Script of getting all the pictures’ URL of Photobucket’s album in PHP

http://s283.photobucket.com/albums/kk285/konnarak_1608/romantic/
Using above album for example.

Click here for Demo

<?php
$url = 'http://s283.photobucket.com/albums/kk285/konnarak_1608/romantic/';
$str = file_get_contents($url);
preg_match_all('/<img[^>]+>/i',$str, $result); 

foreach( $result as $img_tag) {
	foreach( $img_tag as $img) {
		if( !strpos($img, 'class="under off"') ) continue;
		preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $img, $imgURLs);
		$imgURL = str_replace("/th_", "/", $imgURLs[1]);
		echo $imgURL . "<br />";
	}
}
?>