Skip to content

Instantly share code, notes, and snippets.

@bokutin
Created June 11, 2016 20:13
Show Gist options
  • Save bokutin/3b072c031e1ab982cc1330f73bb03050 to your computer and use it in GitHub Desktop.
Save bokutin/3b072c031e1ab982cc1330f73bb03050 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl
use Modern::Perl;
use HTML::TreeBuilder::LibXML;
use JSON;
use LWP::UserAgent;
use URI;
use URI::QueryParam;
use YAML::Syck;
binmode STDOUT, ":utf8";
my $ua = LWP::UserAgent->new(
agent => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5',
timeout => 5,
);
my $uri = URI->new('http://www.google.co.jp/search?hl=en&output=search&num=100');
$uri->query_param( 'q' => 'node.js' );
my $res = $ua->get($uri);
if ($res->is_success) {
my $html = $res->decoded_content;
my $tree = HTML::TreeBuilder::LibXML->new;
# use XML::LibXML::PrettyPrint;
# my $document = $tree->{node};
# my $pp = XML::LibXML::PrettyPrint->new(indent_string => " ");
# $pp->pretty_print($document);
# die $document->toString;
$tree->parse($html);
$tree->eof;
my @anchors = $tree->findnodes('//*[@id="search"]//*[@class="r"]//a');
die unless @anchors == 100;
for (@anchors) {
state $json = JSON->new->canonical;
say $json->encode( { title => $_->as_text, href => $_->attr('href') } );
}
}
else {
die $res->status_line;
}
__END__
どれも使えなかった。。。2016-06-12
use Google::Ranker;
use Google::Search;
use WWW::Google::CustomSearch;
https://github.com/benbuckman/nodejs-google-ranking/
% ./grc.pl | recs-totable -k title,href
title href
------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------
Node.js https://nodejs.org/
Download | Node.js https://nodejs.org/en/download/
Node.js (@nodejs) | Twitter https://twitter.com/nodejs?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor
Node.js - Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Node.js
GitHub - nodejs/node: Node.js JavaScript runtime https://github.com/nodejs/node
Node.js Tutorial http://www.tutorialspoint.com/nodejs/
An Absolute Beginner's Guide to Node.js - Modulus Blog http://blog.modulus.io/absolute-beginners-guide-to-nodejs
Node.js 日本ユーザグループ http://nodejs.jp/
Node.js and Visual Studio Code End to End https://code.visualstudio.com/Docs/runtimes/nodejs
02 - Installing Node.js and updating npm | npm Documentation https://docs.npmjs.com/getting-started/installing-node
Node.js image - Docker Hub https://hub.docker.com/_/node/
Why Use Node.js? A Comprehensive Tutorial with Examples | Toptal https://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js
Node.JS developer center | Microsoft Azure https://azure.microsoft.com/en-us/develop/nodejs/
Node.js Fundamentals - YouTube https://www.youtube.com/watch?v=FVdH9YcB3Dg
Node.js - Google Cloud Platform https://cloud.google.com/nodejs/
Getting Started on Heroku with Node.js | Heroku Dev Center https://devcenter.heroku.com/articles/getting-started-with-nodejs
いまアツいJavaScript!ゼロから始めるNode.js入門〜5分で環境構築編〜 http://liginc.co.jp/web/programming/node-js/85318
第一回 Node.jsでどんなことができる?|マルチデバイスLab. - Multi ... http://mdlab.jp/project/node_js/01.html
node.js - Reddit https://www.reddit.com/r/node/
Server-side Development with NodeJS - The Hong Kong University of ... https://www.coursera.org/learn/server-side-development
Node.js Interactive Europe 2016 | Linux Conferences and Linux ... http://events.linuxfoundation.org/events/node-interactive-europe
Node.js Basics Course - Treehouse https://teamtreehouse.com/library/nodejs-basics
Learn Node.js | Code School https://www.codeschool.com/courses/real-time-web-with-node-js
Node.JS Module Patterns https://darrenderidder.github.io/talks/ModulePatterns/
Node.js MongoDB Driver https://docs.mongodb.com/ecosystem/drivers/node-js/
Node.js Tools for Visual Studio - Home https://nodejstools.codeplex.com/
Planet Nodejs http://www.planetnodejs.com/
Express "Hello World" example http://expressjs.com/en/starter/hello-world.html
Node.js Cloud Hosting, Node.js Hosting - Installers and VM - Bitnami https://bitnami.com/stack/nodejs
Node.js ES2015/ES6 support http://node.green/
NodeSchool http://nodeschool.io/
The Node Beginner Book » A comprehensive Node.js tutorial http://www.nodebeginner.org/
Beginner's Guide to Node.js (Server-side JavaScript) - Hongkiat http://www.hongkiat.com/blog/node-js-server-side-javascript/
Node.js - Asynchronous Javascript Framework | TurnKey GNU/Linux https://www.turnkeylinux.org/nodejs
Nodejs - Packages - Package Control https://packagecontrol.io/packages/Nodejs
Node.js Tutorials | Lynda.com https://www.lynda.com/Node-js-training-tutorials/1283-0.html
How To Install Node.js on Ubuntu 16.04 | DigitalOcean https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
Learn and Understand NodeJS | Udemy https://www.udemy.com/understand-nodejs/
Node.js Lessons - Screencast Video Tutorials @eggheadio https://egghead.io/technologies/node
Felix's Node.js Convincing the boss guide http://nodeguide.com/convincing_the_boss.html
Node.js - Quora https://www.quora.com/topic/Node-js
nodejs (New York, NY) - Meetup http://www.meetup.com/nodejs/
Node.js Troubleshooting and Performance Monitoring | New Relic APM http://newrelic.com/nodejs
Node.js - JetBrains https://www.jetbrains.com/help/webstorm/2016.1/node-js.html
Bringing Node.js to Windows 10 IoT Core | Building Apps for Windows https://blogs.windows.com/buildingapps/2015/05/12/bringing-node-js-to-windows-10-iot-core/
Now: realtime node.js deployments - ZEIT https://zeit.co/now
'node.js' tag wiki - Stack Overflow http://stackoverflow.com/tags/node.js/info
Get started with the Bot Builder - Node.js - Bot Framework http://docs.botframework.com/builder/node/overview/
Node.js を5分で大雑把に理解する - Qiita http://qiita.com/hshimo/items/1ecb7ed1b567aacbe559
Node.js :: Eloquent JavaScript http://eloquentjavascript.net/20_node.html
How To Node - NodeJS https://howtonode.org/
Kubernetes - Hello World Walkthrough http://kubernetes.io/docs/hellonode/
13 fabulous frameworks for Node.js | InfoWorld http://www.infoworld.com/article/3064653/application-development/13-fabulous-frameworks-for-nodejs.html
Introduction to Node.js | Pluralsight https://www.pluralsight.com/courses/node-intro
Node.js Reactions http://nodejsreactions.tumblr.com/
The Twilio Node Helper Library - Twilio https://www.twilio.com/docs/libraries/node
Node.js at PayPal | PayPal Engineering Blog https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/
Getting Started - Sequelize | The Node.js / io.js ORM for PostgreSQL ... http://docs.sequelizejs.com/en/latest/docs/getting-started/
Building a Node.js project - Travis CI https://docs.travis-ci.com/user/languages/javascript-with-nodejs
Node Hero - Getting Started With Node.js | @RisingStack http://blog.risingstack.com/node-hero-tutorial-getting-started-with-node-js/
Nodal — API Services Made Easy With Node.js http://nodaljs.com/
- docs.nodejitsu.com https://docs.nodejitsu.com/
Passport http://passportjs.org/
NodeJS Plugin - Jenkins - Jenkins Wiki https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin
Chocolatey Gallery | Node JS 6.2.1 https://chocolatey.org/packages/nodejs
How to Install Node.js on Ubuntu 14.04 - HostingAdvice.com http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/
What is Node.js? - O'Reilly Radar http://radar.oreilly.com/2011/07/what-is-node.html
Node.js | OpenShift Developers - What is OpenShift? https://developers.openshift.com/languages/nodejs/
Node.js grows up with its first stable release - The Next Web http://thenextweb.com/dd/2015/09/09/node-js-grows-up-with-its-first-stable-release/
Google Cloud Platform Blog: Node.js on Google App Engine goes beta https://cloudplatform.googleblog.com/2016/03/Node.js-on-Google-App-Engine-goes-beta.html
Features/NodeJS - FedoraProject https://fedoraproject.org/wiki/Features/NodeJS
IBM developerWorks : nodejs http://www.ibm.com/developerworks/topics/nodejs/
Error Handling in Nodejs - Developer Center - Joyent https://www.joyent.com/developers/node/design/errors
puppetlabs/nodejs · Puppet Forge https://forge.puppet.com/puppetlabs/nodejs
Farewell Node.js — Medium https://medium.com/@tjholowaychuk/farewell-node-js-4ba9e7f3e52b
krakenjs - Give your node.js express apps some extra arms http://krakenjs.com/
Why node.js? | Node.js Embedded Development on the Raspberry Pi ... https://learn.adafruit.com/node-embedded-development/why-node-dot-js
Tag Archive for "node-js" | Scotch https://scotch.io/tag/node-js
io.js - JavaScript I/O https://iojs.org/
Apache Thrift - Node.js https://thrift.apache.org/tutorial/nodejs
Guide to Installing Node.js on a Raspberry Pi | thisDaveJ http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
Node.js: Step by Step - Envato Tuts+ Code Tutorials http://code.tutsplus.com/series/nodejs-step-by-step--net-20500
Node.js Knockout | Nov 7-8th UTC, 2015 http://nodeknockout.com/
NodeJS Nicaragua http://www.nodenica.com/
Node.js Tutorials for Beginners and Programmers | Codementor https://www.codementor.io/nodejs/tutorial
Manning | Node.js in Practice https://www.manning.com/books/node-js-in-practice
Koa - next generation web framework for node.js http://koajs.com/
A Simple Website in Node.js – 2016 Edition | Clock http://www.clock.co.uk/blog/a-simple-website-in-node-js-2016-edition
NuGet Gallery | Node.js 5.3.0 https://www.nuget.org/packages/Node.js/
RequireJS in Node http://requirejs.org/docs/node.html
Node.js / V8 Garbage Collection & Memory Leak analysis http://apmblog.dynatrace.com/2015/11/04/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js/
Arduino Experimenter's Guide for NodeJS http://node-ardx.org/
Node.js integration | Drupal.org https://www.drupal.org/project/nodejs
KeystoneJS · Node.js cms and web application platform built on ... http://keystonejs.com/
Node.js and the new web front-end - NCZOnline https://www.nczonline.net/blog/2013/10/07/node-js-and-the-new-web-front-end/
The fork? Node.js: Code showdown re-opens Open Source wounds ... http://www.theregister.co.uk/2016/05/13/open_source_insider_myth_of_opensource/
Tutorial - Getting Started With Node.js, Express, MongoDB ... http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/
AWS SDK for JavaScript in Node.js - Amazon Web Services https://aws.amazon.com/sdk-for-node-js/
Node.js v0.12, io.js, and the NodeSource Linux Repositories http://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories/
Managing Node.js Versions with nvm - David Walsh Blog https://davidwalsh.name/nvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment