We are about to switch to a new forum software. Until then we have removed the registration on this forum.
String url = "https://" + "twitter.com/*********";//USER URL
String[] lines = loadStrings(url);
String[] status;
String actual_stat;
// Get rid of the array in order to search the whole page
for (int i = 0 ; i < lines.length - 1 ; i++) {
if (lines[i].indexOf("data-permalink-path=") == 0) {
//println(lines[i]);
println("************************************************");
actual_stat=lines[i].substring(lines[i].indexOf("/"), lines[i].length() - 1);
//status = loadStrings("https://" + "twitter.com" + lines[i]);
//println("https://twitter.com" + actual_stat);
status = loadStrings("https://" + "twitter.com" + actual_stat);
//println(status);
for (int j = 0 ; j < status.length ; j++) {
if (status[j].indexOf("Twitter: "") > 0) {
if (status[j].indexOf("<title>") > 0) {
//println(status[j].substring(status[j].indexOf(""") + 6, status[j].indexOf("</title>") - 6));
println(status[j].substring(status[j].indexOf("<title>") + 7, status[j].indexOf("</title>") - 6));
}
}
//println(status[j].indexOf("<a href=" + '"' + actual_stat));
if (status[j].indexOf("tweet-timestamp js-permalink js-nav js-tooltip") > 0 && status[j].indexOf("<a href=" + '"' + actual_stat) > -1) {
println(status[j].substring(status[j].indexOf("title=") + 7, status[j].indexOf("data-conversation") - 3));
}
}
println("************************************************");
}
}
Comments
@FertheBana -- thank you for sharing this!
To prevent this forum formatting from breaking your code, please edit your post above and change any line containing a URL to split the string, like this:
(done)
needs more comments imo
@jeremydouglass thanks, i'll edit it
A new version ready for make some kind of twitter alarm