JSPM

yahoo-jp

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q20790F
  • License MIT

Scrape the search.yahoo.co.jp

Package Exports

  • yahoo-jp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yahoo-jp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-yahoo-jp NPM version Build Status Coverage Status

Scrape the http://search.yahoo.co.jp/search

Installation

$ npm install yahoo-jp --save

API

yahooJp.fetchAll(queries,options) -> Promise(items)

http://search.yahoo.co.jp/searchqueriesを送信し、返された html にある検索結果中のURL,題名、本文を取得し、配列で返します。

var yahooJp= require('yahoo-jp');

var queries= {
  p: 'UE4.8.3',
};
var options= {};

yahooJp.fetchAll(queries,options)
.then(function(items){
  console.log(items);
});
// [
//   {
//     "url": "https://answers.unrealengine.com/questions/218432/476-test-project-stuck-on-splash-screen-on-ios-83.html",
//     "title": "4.7.6 - test project stuck on splash screen on iOS 8.3 - UE4 ...",
//     "body": "2015年4月27日 ... Hello - while using 4.7.6, when I build a test project (or the Blackjack or Tappy \nChicken sample projects) for iOS and deploy the IPA to my iPhone 6 (running iOS \n8.3) the app hangs on the splash screen. When using 4.5.1, ..."
//   },
//   {... more 9 items}
// ]

queriesはそのまま検索のGETパラメータとして使用するので、検索ツールの引数を使用することで、時間で絞込を行うことも可能です。

var yahooJp= require('yahoo-jp');

var queries= {
  p: 'UE4.8.3',
  vd: 'd',// 24時間以内
};
var options= {};

yahooJp.fetchAll(queries,options)
.then(function(items){
  console.log(items);
});
// [
//   {
//     "url": "https://ja.wikipedia.org/wiki/3DCG%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2",
//     "title": "3DCGソフトウェア - Wikipedia",
//     "body": "8.2 乗り物アニメーション; 8.3 群集シミュレーション・人工知能(AI)シミュレーション; 8.4 \nクロスシミュレーション; 8.5 破壊シミュレーション; 8.6 シミュレーション及びエフェクト. 8.6\n.1 ボリュームエフェクト; 8.6.2 メッシュ化; 8.6.3 海洋シミュレーション; 8.6.4 その他 ..."
//   },
//   {... more 9 items}
// ]

options

  • limit 取得するページ数…デフォルト 1

    limitに応じてページリクエストのpstartbは自動で生成します。

  • concurrency 同時リクエスト数…デフォルト 1

    並列でページ取得を試みます。

License

MIT