Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jquery_load(callback){
- if (window.jQuery){
- callback();
- return;
- }
- var js=document.createElement('script');
- js.src='//code.jquery.com/jquery-1.10.2.min.js';
- document.body.appendChild(js);
- function check(){
- if (window.jQuery) callback();
- else setTimeout(check,10);
- }
- check();
- }
- function google_scan(){
- var idx=0;
- var i=0;
- jquery_load(function(){
- $('#ires').html(' ');
- $('#ires').append('<style>ol#qwqwqw li{list-style-type:decimal;}</style>');
- var cont=$('<ol id="qwqwqw" style="list-style-type:decimal;"></ol>');
- $('#ires').append(cont);
- var next_link=$('#pnnext').attr('href');
- function go(){
- $.get(next_link,function(text){
- var d=$(text);
- next_link=d.find('#pnnext').attr('href');
- d.find('h3.r a').each(function(i,k){
- cont.append('<li><a href="'+k.href+'">'+k.href+'</a></li>');
- console.log(k);
- })
- if (next_link) setTimeout(go,Math.round(Math.random()*1000));
- });
- }
- go();
- });
- }
- google_scan();
Add Comment
Please, Sign In to add comment