Mini Bots PHP Class

This PHP class is a growing collection of small spiders and web bots that go out on the web and make some small useful jobs. This help builds your spider php script and brings new functionalities to your works. You can do very nice works with CURL using php and this class, this small web bots can be included in your works.

Actually the mini bots can do those things:

  1. Copy a remote url to your local server: copyFile
  2. Get IP address of the user: getIP
  3. Get geographic informations from IP address: ipToGeo
  4. Get spelling for a word using Google: doSpelling
  5. Make a Tiny URL using tiny url service: doShortURL
  6. Decode a short URL of any service: doShortURLDecode
  7. Check if an URL to an mp3 is really an mp3 file: checkMp3
  8. Check if an URL exists: url_exists
  9. Do SMTP email validation: doSMTPValidation
  10. Get infos of an URL (keywords, title, images, description, favicon…): getUrlInfo
  11. Get infos of a VIDEO URL (title, description, thumb for youtube and vimeo services): getVideoUrlInfo
  12. Read facebook counters for likes, shares, comments, clicks…: readFacebookCounters
  13. Read the numbers of time a URL has been twitted: readTwitterCounter
  14. Read Google +1s counter for an URL: readGooglePlusCounter
  15. Get Google suggested keywords for a keyword: googleSuggestKeywords
  16. Get Latitude and Longitude (georeference) from an address with Google: getLatLong
  17. Get Wikipedia definition: wikiDefinition
  18. Get Vimeo Info on a video: getVimeoInfo
  19. Get exchange rates, currency converter: getExchangeRateFromTo
  20. Get push notification on android devices: notifyNma
  21. Ping pingomatic services: pingomatic
  22. Get images by keyword with PicSearch: getImage
  23. Get images by keyword with Google: getImageGoogle NEW
  24. Get images and user data from an Instagram username: getInstagramPics
  25. Get detailed informations from an Instagram image url: getInstagramPic NEW
  26. Get twitter user data (followers/followings/avatar): twitterInfo
  27. Get a page, find links, find emails… and more methods for spidering.
  28. Get gravatar image from email address: getGravatar NEW
  29. Get Linkedin counter: getLinkedinCounter NEW
  30. Get Pinterest counter: getPinterestCounter NEW
  31. Get Google back links count for a domain: getGoogleBackLinks NEW
  32. Get Google number of indexed pages for a domain: getGoogleIndexedPages NEW

Future updates will bring new mini bots for you!

You can play with interactive demos here.

Here is a tutorial on how to build a spider.

You can watch complete demo and buy it on CodeCanyon:

Price: 7$

Here are some online tools made using this php class:

Anything to say?

Comments with Facebook or below with WordPress



WordPress comments:

  1. complimenti però sappiate che Google non gradisce che si facciano query nei suoi servizi che non prevedono API, potrebbe penalizzare un sito che serve i dati con il grabbing

  2. Credo che l’importante sia non abusarne, anche Google fa grabbing a tutti i livelli, non sono sicuro che penalizzi queste attività, dove l’hai letto?

  3. […] there are 17 bots included in this class! Well I’ve updated the mini bots class with some new things: you can now retrive the list of videos from a Youtube user, you can retrieve […]

  4. I just tried updating my twitter status with the mini bot’s twitterSetStatus() function and the functioned returned false which indicates that my status was not updated. I verified on twitter and no update was set to my status.

    Does this have anything to do with the oAuth implementation of twitter?

    Any ideas to get twitter update status to work in the near future?

  5. Yes. Since 31, 2010 twitter made basic autenthication deprecated, I will soon make available a different version of the function (I hope).

  6. Bel lavoro davvero !

    peccato che tu non abbia scelto una licence per questo script.
    The Free Software Foundation has recommended that the GNU AGPLv3 be considered for any software that will commonly be run over a network

    Saluti dalla Bretagna,
    Ronan

  7. Hey, Thanks for class.

    I modify the googleGetImages function for get a especify quanty.

    public function googleGetImages($k, $quant = 20) {
    		$x = array();
    		$next = 0;	
    		while ($next < $quant) {
    			$url = "http://www.google.com.br/images?q=##query##&gbv=2&sout=1&tbs=isch:1,itp:##query##&sa=N&start=##next##&ndsp=20";
    			$web_page = file_get_contents( str_replace(array("##query##", "##next##"), array(urlencode($k), $next), $url ));
    			$tieni = stristr($web_page,"dyn.setResults(");
    			$tieni = str_replace( "dyn.setResults(","", str_replace(stristr($tieni,");"),"",$tieni) );
    			$tieni = str_replace("[]","",$tieni);
    			$m = preg_split("/[\[\]]/",$tieni);
    			
    			for($i=0;$i<count($m);$i++) {
    				$m[$i] = str_replace("/imgres?imgurl\\x3d","",$m[$i]);
    				$m[$i] = str_replace(stristr($m[$i],"\\x26imgrefurl"),"",$m[$i]);
    				$m[$i] = preg_replace("/^\"/i","",$m[$i]);
    				$m[$i] = preg_replace("/^,/i","",$m[$i]);
    				if ($m[$i]!="") {
    					array_push($x,$m[$i]);
    					if (++$next >= $quant)
    						break;
    				}
    			}
    		}		
    		return $x;
    	}
    

  8. Another small change

    // get list of images from google images
    //$k == query to search
    //$quant == total of itens that you need
    //$check == check if image link is broken (depending on the amount of images, the time to check them becomes too long. Use only if absolutely necessary.)
    public function googleGetImages($k, $quant = 20, $check = false) {
    	$x = array();
    	$next = 0;	
    	while ($next < $quant) {
    		$url = "http://www.google.com/images?q=##query##&gbv=2&sout=1&tbs=isch:1&sa=N&start=##next##&ndsp=20";
    		$web_page = file_get_contents( str_replace(array("##query##", "##next##"), array(urlencode($k), $next), $url ));
    		$tieni = stristr($web_page,"dyn.setResults(");
    		$tieni = str_replace( "dyn.setResults(","", str_replace(stristr($tieni,");"),"",$tieni) );
    		$tieni = str_replace("[]","",$tieni);
    		$m = preg_split("/[\[\]]/",$tieni);
    		
    		for($i=0;$i<count($m);$i++) {
    			$m[$i] = str_replace("/imgres?imgurl\\x3d","",$m[$i]);
    			$m[$i] = str_replace(stristr($m[$i],"\\x26imgrefurl"),"",$m[$i]);
    			$m[$i] = preg_replace("/^\"/i","",$m[$i]);
    			$m[$i] = preg_replace("/^,/i","",$m[$i]);
    			if ($m[$i]!="") {
    				if ($check) {
    					if (@getimagesize($m[$i])) {
    						array_push($x,$m[$i]);
    						if (++$next >= $quant)
    							break;
    					}
    				} else {
    					array_push($x,$m[$i]);
    					if (++$next >= $quant)
    						break;
    				}
    			}
    		}
    	}		
    	return $x;
    }
    

  9. Just what i needed, twitter status change without messy oAuth !!! Thanks bro, excellent !!!

  10. Sto provando il codice di Douglas per recuperare l’immagine da Google Images, ma ottengo sempre un errore di sintassi T_PUBLIC. Ho tolto il public alla funzione e non restituisce più l’errore ma non ritorna niente, pagina bianca (test effettuato tramite XAMPP).

    prima della classe ho semplicemente inserito una riga così:
    $k = “MC544FD/A”;
    Dopodichè ho modificato quantità in 1 ed abilitato il check dell’esistenza dell’immagine.

    Devo inserire altro codice per visualizzare l’immagine?

    Inoltre è possibile inserire un controllo “di pertinenza”? Mi spiego, se il primo risultato ha un nome estremamente diverso da quello cercato (e lo chiedo perchè io sto cercando dei codici di prodotto) è possibile dire allo script di skippare il grab dell’immagine?

    Grazie mille!

  11. I will use this class in my collection of web directories and submission form. Thanks.
    Directory Gist – Directory of Web Directories –
    http://www.directorygist.com
    ———–
    Searcheable database of 7000 free web directories, Search Engines, social BookMarking Sites, Article Directories. Also online submission tools to ease your website promotion.

  12. Great Class! Any chance of getting the source to the demo pages? I got the twitter class working, with _post[“u”] etc, but I think what I have can be done better. Plus when I submit it, it just displays a double of my twitter form where the result should say, bad, ok, etc.

    Could I possibly get the code for the twitter demo page?

  13. hi i like your work but how to use it i m new to php, what i whould to do is to get link of first 3 image ( and medium size)

    $k = ‘demo’;
    $images = googleGetImages($k, $quant = 3, $check = false)
    print_r $images;

  14. Hii,
    I want to get latitude and longitude from address.
    The demo which you have shown is mapping exactly.
    Can you provide me the entire source.
    Im new to PHP and not able to link it.
    Please help me

  15. Do you ever tried to curl dropbox.com ?

    Looks impossible but i don’t know why….

    Love your bot class by the way

    thanks



Sorry, WordPress comments are closed.