Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding 'WebPage#close' calls where appropriate in example scripts.

  • Loading branch information...
commit f61635f2d49616322789b98220167d22073408e5 1 parent c9f9b5a
@JamesMGreene JamesMGreene authored committed
View
4 examples/follow.coffee
@@ -1,11 +1,12 @@
# List following and followers from several accounts
-users= [
+users = [
'ariyahidayat'
'detronizator'
'KDABQt'
'lfranchi'
'jonleighton'
+ '_jamesgreene'
]
follow = (user, callback) ->
@@ -16,6 +17,7 @@ follow = (user, callback) ->
else
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
console.log user + ': ' + data
+ page.close()
callback.apply()
process = () ->
View
4 examples/follow.js
@@ -4,7 +4,8 @@ var users = ['ariyahidayat',
'detronizator',
'KDABQt',
'lfranchi',
- 'jonleighton'];
+ 'jonleighton',
+ '_jamesgreene'];
function follow(user, callback) {
var page = require('webpage').create();
@@ -17,6 +18,7 @@ function follow(user, callback) {
});
console.log(user + ': ' + data);
}
+ page.close();
callback.apply();
});
}
View
2  examples/render_multi_url.coffee
@@ -23,7 +23,7 @@ renderUrlToFile = (url, file, callback) ->
else
page.render file
- delete page
+ page.close()
callback url, file
# Read the passed args
View
2  examples/render_multi_url.js
@@ -28,7 +28,7 @@ function renderUrlToFile(url, file, callback) {
} else {
page.render(file);
}
- delete page;
+ page.close();
callback(url, file);
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.