Skip to content

fadidevv/tor-with-curl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Tor with CURL - PHP Scraper

N|Solid

Build Status

PHP Tor + cURL + Simple-Html-Dom api to securely make any HTTP GET/POST requests or scrape websites.

  • Protected from webcrawler detectors
  • fully supported popular web-scraper SHP
  • Created for making GET/POST requests securely

Requirements

  • PHP 5.3 or higher
  • cURL
  • Simple Html Dom
  • Tor installed in server

Installation

Just download api.php && simple_html_dom.php class in your project folder and start using this powerful API for making HTTP GET/POST requests or scraping websites securely.

Example of GET request

require 'simple_html_dom.php'; // include a simple-html-dom class 
require 'api.php';  // include a api class 
$api = new Api(); // initialized api class
echo $api->getApiResponse('http://example.com'); // if 200 code return results else 404 code return '404'

Example of Scraping web-pages

require 'simple_html_dom.php'; // include a simple-html-dom class 
require 'api.php';  // include a api class 
$api = new Api(); // initialized api class
$results = $api->getApiResponse('http://example.com'); // if 200 code return results else 404 code return '404'
echo $results->find('title', 0)->innertext; // scrape title from results of request using simple-html-dom

Available methods

getApiResponse(<string>, <array>)

getApiResponse( 'http://example.com' ); // for making simple GET HTTP requests
getApiResponse( 'http://example.com', 
    array( 'id' => 'somevalue', 'price' => 'somevalue'));  // for making simple POST HTTP requests

Please note: You need to have TOR installed and running in your Apache or any linux server.

License

MIT

Releases

No releases published

Packages

No packages published

Languages