PHP Check Proxies


Hits: 5126  
<?php
function checkProxies($proxies){
 
 $url = 'https://www.svnlabs.com/'; 
 
 $count = count($proxies); 
 
 echo 'Number of proxies in file: ' . $count . '<br />';

 $curl_arr = array();
 $master = curl_multi_init(); 

 for($i = 0; $i < $count; $i++) {
 $proxy = $proxies[$i]; 
 $curl_arr[$i] = curl_init(); 
 curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, TRUE); 
 curl_setopt($curl_arr[$i], CURLOPT_HEADER, FALSE); 
 curl_setopt($curl_arr[$i], CURLOPT_URL, $url); 
 curl_setopt($curl_arr[$i], CURLOPT_CONNECTTIMEOUT, 10); 

 $cproxy = explode(',', $proxy); 
 curl_setopt($curl_arr[$i], CURLOPT_PROXY, $cproxy[0]); 

 if($cproxy[1]) { 
 curl_setopt($curl_arr[$i], CURLOPT_PROXYUSERPWD, $cproxy[1]); 
 }
 curl_multi_add_handle($master, $curl_arr[$i]); 
 }

 $running = null;
 
 do {
 curl_multi_exec($master,$running); 
 } while($running > 0);

 
 for($i = 0; $i < $count; $i++) {
 
 echo $i . '. ' . $proxies[$i] .' > '. curl_error($curl_arr[$i]). '<br /><br />';
 
  
 }
 

 curl_multi_close($master); 


}


foreach (glob("full_list_new/*.txt") as $filename) {

$proxies = file($filename); 
$proxies = checkProxies($proxies);     
    
}

?>

Get Proxy List from http://hidemyass.com/proxy-list/

SVNLabs Tools


Hits: 2593  

HTML2CSV converts html/xhtml to csv/xls.

VMG2TXT converts Nokia VMG message file to text file.

VCard Parser Extract information from VCard.

HTML2RSS converts html/xhtml to rss/xml feed.

Amazon S3 upload file to Amazon S3 Bucket.

CSV Mapper Import CSV file after adjusting Columns.

JavaScript Twitter Bird

a2zVideoAPI – search videos with page link

EBook Search Engine

Google Map Info Window

PHP Syntax Highlighter.

Backup mysql database to amazon S3.

The best way to consume API


Hits: 4712  
 
SOAP UI
 
<?php

require_once('lib/nusoap.php');

$url = "http://www.hotelscombined.com/api/wsdl/SearchSoap.wsdl"; // web service URL 

$client = new nusoap_client($url, false); // soap client to consume API

// XML payload from "soapUI" to send over wsdl server
$xmlRequest='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:hot="http://schemas.datacontract.org/2004/07/HotelsCombined.WebServices.Version4">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:HotelSearch>
         <!--Optional:-->
         <tem:request>
            <hot:ApiKey>?</hot:ApiKey>
            <hot:Checkin>?</hot:Checkin>
            <hot:Checkout>?</hot:Checkout>
            <hot:DisplayCurrency>?</hot:DisplayCurrency>
            <hot:Guests>?</hot:Guests>
            <hot:HotelID>?</hot:HotelID>
            <hot:LanguageCode>?</hot:LanguageCode>
            <hot:Rooms>?</hot:Rooms>
            <hot:TimeOutInSeconds>?</hot:TimeOutInSeconds>
            <hot:UserAgent>?</hot:UserAgent>
            <hot:UserID>?</hot:UserID>
            <hot:UserIPAddress>?</hot:UserIPAddress>
         </tem:request>
      </tem:HotelSearch>
   </soapenv:Body>
</soapenv:Envelope>';

$return = $client->send($xmlRequest, $url);  // send xml to service url

print_r($return);  // excepted output 😉

?>

Don’t find fault. Find a remedy.

How to check RTMP source stream is live or not?


Hits: 22014  
RTMP Source Check RTMP Source RTMP Live Stream

Dear Friends,
You can check RTMP Source is live or not using socket programming, but that will not give you exact output. Today I have tried Linux utility “rtmpdump” to test & check RTMP Source it produced quite interesting results on command line….

# rtmpdump -v -r rtmp://giraldatvlivefs.fplive.net/giraldatvlive-live/stream001 -o /tmp/rtmp-checker.log

RTMP Output
<?php

/* 
 * 
 * RTMPChecker - by S V N L A B S () (blog.svnlabs.com)
 * You can use and modify this code as long as the above reference to me still exists 😉
 * 
 */

if(isset($_REQUEST['stream']) && $_REQUEST['stream']!="")
{

  exec("/usr/bin/rtmpdump -V  -v -r '".$_REQUEST['stream']."' -o /tmp/rtmp-checker.log 2>&1", $pp);
  echo implode("<br>", $pp);

}


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Check RTMP is live or not?</title>
</head>
<body>

<form name="rtmp" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="stream" value="rtmp://164.100.49.14:80/live/dd2" /><br />
<input type="submit" name="check" value="check" />
</form>

</body>
</html>

Output may be…

Night is longer than day for those who dream & Day is longer than nights for those who MAKE their DREAMS come true…

Save Facebook Profile Photo


Hits: 3018  
<?php

$facebook_uid = '100000296428149';
$sourcecode = save_facebook_profile_photo($facebook_uid);

print_r($sourcecode);

file_put_contents("images/".$facebook_uid.".jpg", file_get_contents($sourcecode['url'])); //this is name of new file that i save

function save_facebook_profile_photo( $id )
{
    $options = array(
        CURLOPT_RETURNTRANSFER => true,     // return web page
        CURLOPT_HEADER         => false,    // don't return headers
        CURLOPT_FOLLOWLOCATION => true,     // follow redirects
        CURLOPT_ENCODING       => "",       // handle all encodings
        CURLOPT_USERAGENT      => "spider", // who am i
        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
        CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
        CURLOPT_TIMEOUT        => 120,      // timeout on response
        CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
    );
    
    $url = "http://graph.facebook.com/".$id."/picture";

    $ch      = curl_init( $url );
    curl_setopt_array( $ch, $options );
    $content = curl_exec( $ch );
    $err     = curl_errno( $ch );
    $errmsg  = curl_error( $ch );
    $header  = curl_getinfo( $ch );
    curl_close( $ch );

    //$header['errno']   = $err;
    //$header['errmsg']  = $errmsg;
    //$header['content'] = $content;
    print($header[0]);
    return $header;
}  

?>

Facebook Search Users with Email and Save to Database


Hits: 2310  

Search Facebook Users in Facebook website and save to any external database (text, csv, json, xml etc.)……

Amazon E-Commerce Service or ECS


Hits: 2261  

Amazon’s ECS is very good service for accessing Amazon’s product database. We can register to this web service quickly, It provides a free access key to access Amazon Store.

Amazon have rich set of web services 🙂 Web Services are used to access DATA over cross platform environments.

Using ECS-driven websites and applications, we can earn commissions by advertising items for sale by Amazon.

Amazon E-Commerce Service can be used to get the information from amazon such as product name, images, availability, ratings, description, specifications, similar products, and more.

We can use PHP to consume web service using PEAR, REST, SOAP and XML etc.

Try: https://github.com/Exeu/Amazon-ECS-PHP-Library

There is one thing which gives radiance to everything. It is the idea of something around the corner.

Block badAgents on site


Hits: 1941  

PHP is very powerful language to block bad agents. Below is the code to avoid webspider using PHP in_array().

<?php
$badAgents
= array(‘Acunetix Web Vulnerability Scanner’, ‘Bot\ mailto:craftbot@yahoo.com’, ‘ChinaClaw’, ‘Custo’, ‘DISCo’, ‘Download\ Demon’, ‘eCatch’, ‘EirGrabber’, ‘EmailSiphon’, ‘EmailWolf’, ‘Express\ WebPictures’, ‘ExtractorPro’, ‘EyeNetIE’, ‘FlashGet’, ‘GetRight’, ‘GetWeb!’, ‘Go!Zilla’, ‘Go-Ahead-Got-It’, ‘GrabNet’, ‘Grafula’, ‘HMView’, ‘HTTrack’, ‘Image\ Stripper’, ‘Image\ Sucker’, ‘Indy\ Library’, ‘InterGET’, ‘Internet\ Ninja’, ‘JetCar’, ‘JOC\ Web\ Spider’, ‘larbin’, ‘LeechFTP’, ‘Mass\ Downloader’, ‘MIDown\ tool’, ‘Mister\ PiX’, ‘Navroad’, ‘NearSite’, ‘NetAnts’, ‘NetSpider’, ‘Net\ Vampire’, ‘NetZIP’, ‘Octopus’, ‘Offline\ Explorer’, ‘Offline\ Navigator’, ‘PageGrabber’, ‘Papa\ Foto’, ‘pavuk’, ‘pcBrowser’, ‘RealDownload’, ‘ReGet’, ‘SiteSnagger’, ‘SmartDownload’, ‘SuperBot’, ‘SuperHTTP’, ‘Surfbot’, ‘tAkeOut’, ‘Teleport\ Pro’, ‘VoidEYE’, ‘Web\ Image\ Collector’, ‘Web\ Sucker’, ‘WebAuto’, ‘WebCopier’, ‘WebFetch’, ‘WebGo\ IS’, ‘WebLeacher’, ‘WebReaper’, ‘WebSauger’, ‘Website\ eXtractor’, ‘Website\ Quester’, ‘WebStripper’, ‘WebWhacker’, ‘WebZIP’, ‘Wget’, ‘Widow’, ‘WWWOFFLE’, ‘Xaldon\ WebSpider’, ‘Zeus’);
if(
in_array($_SERVER[‘HTTP_USER_AGENT’],$badAgents)) {
exit();
}
?>
 

a2zVideoAPI WordPress Plugin


Hits: 3823  

a2zVideoAPI WordPress Plugin: http://blog.svnlabs.com/a2zVideoAPI.zip

http://wordpress.org/extend/plugins/a2zvideoapi/

Plugin Name: a2zVideoAPI widget
Plugin URI: http://svnlabs.com/a2zvideoapi/
Description: a2zVideoAPI allows you to add a sidebar widget to show video from various sites including youtube, dailymotion, google, vimeo, metacafe, blip.tv, hulu, 5min, myspace, ehow, break, flickr etc.
Author: Sandeep Verma
Version: 0.7
Author URI: http://blog.svnlabs.com
Other: Curl must be on your server to use this plugin. This widget tested to latest version of wordpress.

Installation:

1. Download a2zVideoAPI.zip
2. Extract and upload a2zVideoAPI.php to the plugins/ directory
3. Enable a2zVideoAPI Widget in the Plugin admin panel
4. Place a2zVideoAPI in the sidebar, and edit it to enter the Video URL

Other Links:
http://code.google.com/p/a2zvideoapi/
http://github.com/svnlabs

Download API: http://www.svnlabs.com/a2zvideoapi/a2zVideoAPI.zip
Download Plugin: http://blog.svnlabs.com/a2zVideoAPI.zip

FaceBook Application: http://apps.facebook.com/atozvideoapi/

Follow me:

Facebook: http://www.facebook.com/svnlabs
Twitter: http://www.twitter.com/svnlabs

Subscribe me:
Youtube: http://www.youtube.com/user/svnlabs
Feeds: http://blog.svnlabs.com/feed/

RESTClient – Web Service Consumer


Hits: 2897  

RESTClient is an application use to visit and test RESTful services.

REST (Representational State Transfer) is the model of the Web to consume web resources. The browser makes a request to a URL and receives a response.  The request may be a GET or POST (or a PUT, DELETE, or HEAD) and the response may be anything HTML, Image file, PDF, XML, JSON etc.

Some RESTful Web Services…

http://www.flickr.com/services/api/

http://code.google.com/p/a2zvideoapi/

RESTClient extension: https://addons.mozilla.org/en-US/firefox/addon/9780