mirror of
https://github.com/ariya/phantomjs.git
synced 2024-09-11 12:55:33 +03:00
Fix Twitter-related examples to work with the new site.
http://code.google.com/p/phantomjs/issues/detail?id=609
This commit is contained in:
parent
9c05341698
commit
91d31ffe9e
@ -32,6 +32,7 @@ Please see also http://code.google.com/p/phantomjs/wiki/ReleaseNotes.
|
||||
* Fixed example scripts to exit with the right exit code (issue 544)
|
||||
* Fixed build failure with glib 2.31.0+ (issue 559)
|
||||
* Fixed error handler failures in some cases (issue 589)
|
||||
* Fixed Twitter-related examples to work with the new site (issue 609)
|
||||
|
||||
2012-03-20: Version 1.5.0 "Ghost Flower"
|
||||
|
||||
|
@ -14,7 +14,7 @@ follow = (user, callback) ->
|
||||
if status is 'fail'
|
||||
console.log user + ': ?'
|
||||
else
|
||||
data = page.evaluate -> document.querySelector('div.timeline-following').innerText
|
||||
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
||||
console.log user + ': ' + data
|
||||
callback.apply()
|
||||
|
||||
|
@ -13,7 +13,7 @@ function follow(user, callback) {
|
||||
console.log(user + ': ?');
|
||||
} else {
|
||||
var data = page.evaluate(function () {
|
||||
return document.querySelector('div.timeline-following').innerText;
|
||||
return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
||||
});
|
||||
console.log(user + ': ' + data);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ page.open encodeURI("http://mobile.twitter.com/#{twitterId}"), (status) ->
|
||||
else
|
||||
# Execute some DOM inspection within the page context
|
||||
page.evaluate ->
|
||||
list = document.querySelectorAll 'span.status'
|
||||
list = document.querySelectorAll 'div.tweet-text'
|
||||
for i, j in list
|
||||
console.log "#{j + 1}: #{i.innerHTML.replace /<.*?>/g, ''}"
|
||||
console.log "#{j + 1}: #{i.innerText}"
|
||||
phantom.exit()
|
||||
|
@ -27,9 +27,9 @@ page.open(encodeURI("http://mobile.twitter.com/" + twitterId), function (status)
|
||||
} else {
|
||||
// Execute some DOM inspection within the page context
|
||||
page.evaluate(function() {
|
||||
var list = document.querySelectorAll('span.status');
|
||||
var list = document.querySelectorAll('div.tweet-text');
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
console.log((i + 1) + ": " + list[i].innerHTML.replace(/<.*?>/g, ''));
|
||||
console.log((i + 1) + ": " + list[i].innerText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user