Tweet2Bbcode Bookmarklet

Proporciona el código BBCODE de un tweet tipo "STATUS"
Especialmente útil para NOTICIERO DIGITAL

12/12/2016 Modificaciones :

  • En tweets donde hay posteadas varias fotos, se capturan todas las fotos, a diferencia de las versiones anterioriores que sólo capturaban la primera.
  • En tweets donde el nombre viene acompañado de emojis, las versiones anteriores fallaban. en la actual capturan el nombre junto con los emojis.
  • En tweets de cuentas verificadas se presenta el ícono respectivo.
  • Los elementos avatar, nombre(full), nombre de cuenta ,link del tweet(dentro de la fecha-hora), se presentan en una sola línea.
  • Cambios cométicos.

29/11/2016:
Modificaciones al código
http://pastebin.com/2Z7b552D
  • Con el código anterior se mostraba un link pic.twitter que está en el tweet pero que se supone debe estar oculto. Con el modificado permanece oculto.
  • Se encierra todo el código BBCODE entre etiquetas Quote.
  • Atendiendo la sugerencia de Tubazo,fueron reemplazadas las etiquetas url por etiquetas link, de manera que los links no aparezcan subrayados.

A los pocos que hayan agregado el bookmarklet, favor eliminar y agregar la nueva versión.

Código anterior para quien pueda interesar:
http://textuploader.com/d5yuq

Source (www.noticierodigital.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%20d%3Ddocument%3Bvar%20Colorhex%3D%27%230084B4%27%3Bvar%20tp%3Dd.querySelector%28%27.permalink-tweet%27%29%3Bvar%20cp%3Dtp.querySelector%28%27.TweetTextSize%27%29%3Bvar%20vf%3Dtp.querySelector%28%27span%5Bclass*%3D%22verified%22%5D%27%29%3F%27%5Bimg%5Dhttps%3A//ton.twitter.com/hc_assets/1307051244_737.png%5B/img%5D%27%3A%22%22%3Bfunction%20removeAllAttrs%28element%29%7Bfor%28var%20i%3Delement.attributes.length%3Bi--%3E0%3B%29if%28element.attributes%5Bi%5D.nodeName%21%3D%3D%22href%22%29element.removeAttributeNode%28element.attributes%5Bi%5D%29%3B%7Dvar%20p%3Dcp.cloneNode%28true%29%3Bvar%20uh%3Dp.querySelector%28%27a%5Bclass%24%3D%22u-hidden%22%5D%27%29%3Bif%28uh%29%7Bp.removeChild%28uh%29%3B%7Dvar%20lnk%3Dp.getElementsByTagName%28%27a%27%29%3Bfor%28var%20k%3D0%3Bk%3Clnk.length%3Bk++%29%7Bif%28lnk%5Bk%5D.attributes.length%3E0%29removeAllAttrs%28lnk%5Bk%5D%29%3Blnk%5Bk%5D.setAttribute%28%22href%22%2Clnk%5Bk%5D+%22%22%29%3B%7Dvar%20bbcodetext%3Dp.innerHTML%3Bbbcodetext%3Dbbcodetext.replace%28/%3Cspan%20class%3D%22invisible%22%3E%5B%5E%3C%5D*%3C%5C/span%3E/g%2C%22%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3CBIG%3E/gi%2C%22%5Bb%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3C%5C/BIG%3E/gi%2C%22%5B/b%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3CB%3E/gi%2C%22%5Bb%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3C%5C/B%3E/gi%2C%22%5B/b%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3CIMG%5B%5Cs%5CS%5D*%3FSRC%3D%5C%22%28%5B%5Cs%5CS%5D*%3F%29%5C%22%5B%5Cs%5CS%5D*%3F%3E/gi%2C%22%5Bimg%5D%241%5B%5C/img%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3CA%5Cs*HREF/gi%2C%22%3CA%20HREF%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3CA%20HREF/gi%2C%22%5Blink%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3C%5C/A%3E/gi%2C%22%5B/color%5D%5B/link%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3C%5C/*s%3E/gi%2C%22%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%3C%5B%5E%3E%5D*%3E/g%2C%22%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%22%3E/g%2C%22%5D%5Bcolor%3D%22+Colorhex+%22%5D%22%29%3Bbbcodetext%3Dbbcodetext.replace%28/%22http/g%2C%22http%22%29%3Bvar%20pn%3Dcp.parentNode%3Bvar%20t%3Dd.createElement%28%22textarea%22%29%3Bt.rows%3D12%3Bvar%20style1%3Dd.createElement%28%27style%27%29%3Bstyle1.type%3D%27text/css%27%3Btry%7Bstyle1.innerHTML%3D%27textarea%7Bwidth%3A%20500px%3B%7D%27%7Dcatch%28error%29%7Bstyle1.styleSheet.cssText%3D%27textarea%7Bwidth%3A%20500px%3B%7D%27%7D%3Bd.getElementsByTagName%28%27head%27%29%5B0%5D.appendChild%28style1%29%3Bt.style.backgroundColor%3D%22%23CCEECC%22%3Bpn.insertBefore%28t%2Ccp%29%3Bvar%20fn%3Dtp.querySelector%28%27strong%5Bclass%5E%3D%22fullname%22%5D%27%29%3Bvar%20fne%3Dfn.childNodes%3Bvar%20fnNode%3D%22%22%3Bvar%20fnel%3D%22%22%2Cemu%3Bfor%28var%20i%3D0%3Bi%3Cfne.length%3Bi++%29%7Bfnel%3Dfne%5Bi%5D%3Bif%28fnel.nodeType%3D%3D3%29fnNode+%3Dfnel.wholeText%3Belse%20if%28/emoji/i.test%28fnel.className%29%29fnNode+%3D%27%5Bimg%5D%27+fnel.style.backgroundImage.slice%284%2C-1%29.replace%28/%22/g%2C%22%22%29+%27%5B/img%5D%27%3B%7Dvar%20un%3Dtp.querySelector%28%27span%5Bclass%5E%3D%22username%22%5D%27%29.lastChild.innerHTML%3Bvar%20avNode%3Dtp.querySelector%28%27img%5Bclass%5E%3D%22avatar%22%5D%27%29%3Bvar%20u%3DavNode.parentNode+%22%22%3Bvar%20avI%3DavNode.src.replace%28/_bigger/%2C%22_normal%22%29%3Bvar%20ur%3Dtp.querySelector%28%27a%20span%5Bclass%5E%3D%22_timestamp%22%5D%27%29.parentNode%3Bif%28ur.hasAttribute%28%22data-original-title%22%29%29%7Bvar%20hf%3Dur.getAttribute%28%22data-original-title%22%29%3B%7Delse%20if%28ur.hasAttribute%28%22title%22%29%29%7Bvar%20hf%3Dur.getAttribute%28%22title%22%29%3B%7Dur%3Dur+%22%22%3Bbbcodetext%3D%27%5Blink%3D%27+u+%27%5D%5Bimg%5D%27+avI+%27%5B/img%5D%20%5Bb%5D%27+fnNode+%27%5B/b%5D%20%27+vf+%27%5Bcolor%3D%238899A6%5D%[email protected]%27+un+%27%5B/link%5D%20%5Blink%3D%27+ur+%27%5D%27+hf+%27%5B/link%5D%5B/color%5D%5Cn%27+bbcodetext%3Bvar%20imNode%3Dtp.querySelectorAll%28%27div%5Bclass*%3D%22photoContainer%22%5D%27%29%3Bif%28imNode%29%7Bvar%20im%3D%22%22%3Bfor%28var%20i%3D0%3Bi%3CimNode.length%3Bi++%29%7Bim%3Dim+%27%5Bimg%5D%27+imNode%5Bi%5D.firstElementChild.src.replace%28/%5C.jpg%24/%2C%22.jpg%3Asmall%22%29+%27%5B/img%5D%27%3B%7Dbbcodetext%3Dbbcodetext+%27%5Cn%27+im%3B%7Dbbcodetext%3D%27%5Bquote%5D%27+bbcodetext+%27%5B/quote%5D%27%3Bt.innerHTML%3Dbbcodetext%3Bt.addEventListener%28%22click%22%2Cfunction%28%29%7Bthis.select%28%29%3B%7D%29%3B%7D%29%28%29


Rate it:


Tags:

Comments

Comments so far. Add yours.