Advertisement
decembre

GM - Flickr Functional Suite - NEW (by C. Tilford) - With Flickr River Tweak

Jun 2nd, 2014 (edited)
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Flickr - View on View on FlickRiver - Tweak OK 2017 - NO SET for Flickr Functional Suite
  3. // @namespace     http://lamehacks.net
  4. // @description   Adds links to flickriver on flickr group, user, tag and search pages
  5. // @include       http://*.flickr.com/*
  6.  
  7. // @grant          none
  8. // @include     https://www.flickr.com/*
  9. // @include     https://flickr.com/*
  10.  
  11. // @exclude    https://www.flickr.com/photos/*/sets/*
  12.  
  13. // @run-at document-end
  14. // ==/UserScript==
  15.  
  16.  
  17. // TEST RUN == @run-at document-start - NO
  18. // http://stackoverflow.com/questions/26268816/how-to-get-a-greasemonkey-script-to-run-both-at-run-at-document-start-and-at-r
  19. /*
  20. document.addEventListener ("DOMContentLoaded", DOM_ContentReady);
  21. window.addEventListener ("load", pageFullyLoaded);
  22. function DOM_ContentReady () {
  23.    
  24.     console.log ("==> 2nd part of script run.", new Date() );
  25. }
  26. */
  27.  
  28. // OK - 2017 - TWEAK POOL PAGE
  29. var groupRegex = new RegExp(".*?flickr.com/groups/([^\/]*)");
  30. var matched = groupRegex.exec(window.location);
  31.  
  32. if(matched){
  33.     var riverurl = "http://www.flickriver.com/groups/"+ matched[1] +"/pool/interesting/";
  34.     document.getElementsByClassName("subnav-middle")[0].innerHTML += '   | <span>   <a href="'+ riverurl+'">   Pool FlickRiver   </a>  </span>   ';
  35. }
  36.  
  37. var tagRegex = new RegExp(".*?flickr.com/photos/tags/([^\/]*)");
  38. var matched = tagRegex.exec(window.location);
  39. if(matched){
  40.     var riverurl = "http://www.flickriver.com/photos/tags/"+ matched[1] +"/interesting/";
  41.     document.getElementById("SSButtonHugger").innerHTML += ' <span class="slideshow-box"><a href="'+ riverurl+'"><span class="slideshow-link-wrapper">Tags FlickRiver</span></a></span>   ';
  42. }
  43.  
  44.  
  45. // TWEAK PHOTO PAGE
  46. // RegExp(".*?flickr.com/photos/([^\/]*)")
  47. //new RegExp("*?flickr.com\/photos\/([^\/]*)")
  48.  
  49. // OK for:
  50. // https://www.flickr.com/photos/dingesmijn/5883891633/in/pool-portrait_faces_open_minded_
  51. // WORKING :
  52. // https://www.flickr.com/photos/35866663@N06/25837493794/
  53.  
  54.  
  55. // WORKING :
  56. // https://www.flickr.com/photos/outlierimagery/6783183314/in/pool-portrait_faces_open_minded_
  57. // Working but need a special CSS (because OPACITY = O ):
  58. // https://www.flickr.com/photos/outlierimagery/6783183314#comment72157648274250375
  59.  
  60.  
  61. //  OK - 2017 - PHOTO PAGE only - MATch too ALBUM with / without PRO BADGE - ( but SET DISABLE by exclude)
  62.  
  63. var userRegex = new RegExp(".*?flickr.com\/photos\/([^\/]*)");
  64. var matched = userRegex.exec(window.location);
  65. if(matched){
  66.     var riverurl = "http://www.flickriver.com/photos/"+ matched[1] +"/";
  67.     document.getElementsByClassName("attribution-info")[0].innerHTML += '  |  <span ><a href="'+ riverurl+'">F.F.S + FlickRiver</a></span>   ';
  68. }
  69.  
  70.  
  71. //  WORK - 2017 - ALBUM PAGE - DIABLE for Pb FLICKR FUNCTIONAL SUITE - ( but ALBUM DISABLE too by exclude)
  72. // TEST LINK no badge : https://www.flickr.com/photos/houzyep/albums/72157622252159034
  73. // .*?flickr.com\/.*\/albums\/
  74. /*
  75. var userRegex = new RegExp(".*?flickr.com\/.*\/albums\/)");
  76. var matched = userRegex.exec(window.location);
  77. if(matched){
  78.     var riverurl = "http://www.flickriver.com/photos/"+ matched[1] +"/";
  79.     document.getElementsByClassName("attribution-info")[0].innerHTML += '  |  <span ><a href="'+ riverurl+'">View on flickriver</a></span>   ';
  80. }
  81. */
  82.  
  83.  
  84. //  wORK but - DIABLE for Pb FLICKR FUNCTIONAL SUITE - TEST SETS PRO BADGE
  85. // TEST LINK OK : https://www.flickr.com/photos/44313561@N04/sets/72157622676208923
  86. /*
  87. var userRegex = new RegExp(".*?flickr.com\/.*\/sets\/)");
  88. var matched = userRegex.exec(window.location);
  89. if(matched){
  90.     var riverurl = "http://www.flickriver.com/photos/"+ matched[1] +"/";
  91.     document.getElementsByClassName("attribution-info")[0].innerHTML += '  |  <span ><a href="'+ riverurl+'">View on flickriver</a></span>   ';
  92. }
  93. */
  94.  
  95.  
  96. var searchRegex = new RegExp(".*?flickr.com/search/([^\/]*)");
  97. var matched = searchRegex.exec(window.location);
  98. if(matched){
  99.     var sphraseRegex = new RegExp(".*?q=([^&]*)");
  100.     var searchphrase = sphraseRegex.exec(matched[1]);
  101.     var riverurl = "http://flickriver.com/search/"+ searchphrase[1] +"/";
  102.     document.getElementsByClassName("ViewControls")[0].innerHTML += '  |  <span ><a href="'+ riverurl+'">View on flickriver</a></span>   ';
  103. }
  104.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement