Giter Site home page Giter Site logo

bing-php-api's Introduction

Bing PHP API

Example :

$search = new bing_api("help");
$search->setDork('apple');
$search->setCount(50);// number of results on each page
$search->setSubLinks(TRUE);// returns sublinks of the results if available

$search->search(); // start the search & extract the data

var_dump($search->getLinks()); // return the links only
var_dump($search->getResults()); // return the results ( title & link )
array(39) {
  [0]=>
  array(2) {
    ["main"]=>
    array(3) {
      ["title"]=>
      string(5) "Apple"
      ["description"]=>
      string(167) "Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, and expert device ..."
      ["url"]=>
      string(22) "https://www.apple.com/"
    }
    ["sub"]=>
    array(3) {
      ["title"]=>
      string(6) "iTunes"
      ["description"]=>
      string(73) "iTunes. Your music, movies, and TV shows take center stage. iTunes is …"
      ["url"]=>
      string(29) "https://www.apple.com/itunes/"
    }
  }
  [1]=>
  array(1) {
    ["main"]=>
    array(3) {
      ["title"]=>
      string(34) "Fashion Fair - Apple Store - Apple"
      ["description"]=>
      string(89) "Apple Store Fashion Fair store hours, contact information, and weekly calendar of events."
      ["url"]=>
      string(41) "https://www.apple.com/retail/fashionfair/"
    }
  }
  [2]=>
  array(2) {
    ["main"]=>
    array(3) {
      ["title"]=>
      string(22) "Apple Inc. - Wikipedia"
      ["description"]=>
      string(166) "Apple Inc. is an American multinational technology company headquartered in Cupertino, California that designs, develops, and sells consumer electronics, computer ..."
      ["url"]=>
      string(40) "https://en.wikipedia.org/wiki/Apple_Inc."
    }
    ["sub"]=>
    array(3) {
      ["title"]=>
      string(17) "Corporate affairs"
      ["description"]=>
      string(0) ""
      ["url"]=>
      string(58) "https://en.wikipedia.org/wiki/Apple_Inc.#Corporate_affairs"
    }
  }

Output, links only

array(71) {
  [0]=>
  string(21) "http://www.apple.com/"
  [1]=>
  string(26) "https://appleid.apple.com/"
  [2]=>
  string(25) "http://www.apple.com/mac/"
  [3]=>
  string(26) "https://support.apple.com/"
  [4]=>
  string(28) "http://www.apple.com/iphone/"
  [5]=>
  string(26) "http://www.apple.com/ipad/"
  [6]=>
  string(28) "http://www.apple.com/itunes/"
  [7]=>
  string(40) "https://en.wikipedia.org/wiki/Apple_Inc."
  [8]=>
  string(48) "https://en.wikipedia.org/wiki/Apple_Inc.#History"
  [9]=>
  string(49) "https://en.wikipedia.org/wiki/Apple_Inc.#Products"
  [10]=>
  string(59) "https://en.wikipedia.org/wiki/Apple_Inc.#Corporate_identity"
  [11]=>
  string(58) "https://en.wikipedia.org/wiki/Apple_Inc.#Corporate_affairs"
  [12]=>
  string(47) "http://www.marketwatch.com/investing/stock/aapl"
  [13]=>
  string(33) "http://finance.yahoo.com/q?s=AAPL"
  [14]=>...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.