Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var shoeName = "Legend Blue";
- var tweets = new Array();
- function twitterScan() {
- tweets = [].slice.call(document.getElementsByClassName("js-tweet-text"));
- var targetLink = null;
- var foundTweet = tweets.some(function(tweet) {
- if (tweet.innerHTML.indexOf(shoeName) !==-1 &&
- tweet.innerHTML.indexOf("available") !==-1) {
- var foundLink = [].slice
- .call(tweet.querySelectorAll('a.twitter-timeline-link'))
- .some(function(el) {
- if (el.dataset.expandedUrl.indexOf('swoo.sh') !== -1) {
- targetLink = el;
- return true;
- }
- return false;
- });
- if (!foundLink) {
- alert('Found ' + shoeName + ', but couldnt find the link :(');
- }
- return true;
- }
- return false;
- });
- if (targetLink) {
- window.open(targetLink.href);
- } else if (!foundTweet) {
- location.reload(true);
- }
- }
- setTimeout(twitterScan, 150);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement