pouët.net

YTembed.user.js for Pouet's prod page

category: offtopic [glöplog]
Here's the ytEmbed.user.js which replaces the prod's screenshot by a YT embed whenever possible.

I've only used it for a few minutes and I already <3 this.

The code of this user.js ( and the AttentionWhores toggle ) is on the githubs. Feel free to chime in.
added on the 2012-08-22 22:40:32 by p01 p01
Works here in Chrome 21.0.1180.79 + Tampermonkey 2.5.64
although I'm really not sure if I want to use it :)
added on the 2012-08-22 22:45:08 by Tomoya Tomoya
Upload it as a tools/wild prod, I'll thumb it up !
added on the 2012-08-22 22:48:54 by MsK` MsK`
But only if there's a video of it on how to use it!
added on the 2012-08-22 23:03:13 by D.Fox D.Fox
Nice
video capture pls
added on the 2012-08-23 08:11:15 by anni anni
I would like a thumbnail of the vidcap as I do a mouse-over plz.
;P
added on the 2012-08-23 08:14:44 by ringofyre ringofyre
superb
added on the 2012-08-23 08:18:52 by SiR SiR
so now i can finally put youtube videos of pooping horses in my comments on BITS demos! :D
This could be taken so much further. A top of the week/month/year video wall, f.e. :)

What would also be really useful, is some glöperator.js that identifies yt links and pouet prod urls in the same user post ("click to add this yt X url to prod page Y") to make adding video links less tedious. Maybe I do something like this, if there's enough interest from other glöpsters. :)
added on the 2012-08-23 10:44:56 by tomaes tomaes
Somehow I would like to retain the original screenshot too. Maybe showing the screenshot by default and making the YT embed appear on hover.

ringofyre: ?

tomaes: The video wall sound cool. ... It must be possible to generate a playlist too. Maybe I should see that with the Pound-off guys.

From the couple of times I checked the gloperator pages back when I had admin access, I can imagine a gloperator.user.js could be nice. Nothing prevents you from trying to write such helper scripts for userself, and suggest them to the gloperators. I'm sure you've got the JS skills to do that.
added on the 2012-08-23 11:04:41 by p01 p01
poi: I'm working on some unrelated HTML5/JS stuff with number crunching and Web Workers, but I have no experience in doing browser AddOns so far, maybe time to learn something new yet again. ;)
added on the 2012-08-23 11:09:19 by tomaes tomaes
Quote:
Maybe showing the screenshot by default and making the YT embed appear on hover.

how about good old mouse click?
Code:// ==UserScript== // @name Pouet 'YT embed' | v0.02 // @description replace the screenshot of the prods on Pouet.net by the embedded YT capture if possible // @include http://pouet.net/prod.php* // @include http://*.pouet.net/prod.php* // ==/UserScript== /* (c) August 2012 by Mathieu 'P01' HENRI ( http://www.p01.org ). Updated by Kabuto to use original screenshot as placeholder with play button in front. */ !(function() { // replace screenshot by embeded YT capture if possible var screenshot = document.querySelector('img[src^="screenshots/"][title^="screenshot added on the "]'); var yt = screenshot && document.querySelector('#mainDownload ~ a[href*="v="][href*="youtu"]'); if( yt ) { GM_addStyle(".yt-play {display:inline;cursor:pointer;} .yt-play > div {position:relative;height:0;width:89px;} .yt-play > div > div {position:absolute;left:0;top:" + (-31-screenshot.offsetHeight/2) + "px;width:89px;height:62px;border-radius:8px;color:white;font-size:40px;box-shadow:0 0 8px white;background:black;} .yt-play:hover > div > div {background:#C00;}"); screenshot.parentNode.innerHTML = '<div class="yt-play"><div><div>▸</div></div></div>'; var d2 = document.querySelector('.yt-play'); d2.insertBefore(screenshot,d2.firstChild); var f = function(){ var i=document.createElement('iframe'); var code = (yt.href.match(/(v=|youtu\.be\/)([^&\?]+)/)||['']).pop(); i.width=400; i.height=300; i.frameBorder=0; i.allowfullscreen=1; i.src = 'http://www.youtube.com/embed/'+code+'?autoplay=1'; d2.parentNode.appendChild(i); d2.parentNode.removeChild(d2); }; d2.addEventListener("click",f,false); } })();
added on the 2012-08-23 13:32:59 by Kabuto Kabuto
Damn, code got destroyed :-( Pastebin link: http://pastebin.com/raw.php?i=VdSBDCQ4.
added on the 2012-08-23 13:40:28 by Kabuto Kabuto
i remember i made a greasemonkey script long time ago that inserted a thumbnail of the screenshot of every prod in "prods" page. very useful when you are looking for a demo but dont know the name (but not very server bandwidth efficient)
added on the 2012-08-24 00:30:39 by Tigrou Tigrou
big thumb :D BB Image
added on the 2012-08-24 00:43:06 by panic panic
Hi. I rewrote my original script (last one was lost since long time). Here it is.

Basically it adds a thumbnail for every prod in "prod list" page.
Tested successfully on chrome and firefox. With this and YT embed one, it its almost pouet 2.0 at your fingertips. Enjoy.
added on the 2012-08-24 14:41:49 by Tigrou Tigrou
Tigrou: Cool! Could you send a pull request or similar with that user.js. If not, do you mind if I add that user.js to my list on github ( keeping the copyright notice & co of course )

Also that script rocks twice as much with:
Code:// @include http://www.pouet.net/prodlist.php* // @include http://www.pouet.net/search.php* // @include http://pouet.net/prodlist.php* // @include http://pouet.net/search.php*
I would add the 'jpeg' extension for good measure. Alas we can't do much about uppercased and cowboy cased extensions :\
added on the 2012-08-24 15:10:21 by p01 p01
This feature could be nice on the groups.php page as well.

Will try to improve that script to make this a bit more flexible e.g. starting from document.querySelectorAll('a[href*="prod.php?which="]') and discarding the adjacent duplicates.
added on the 2012-08-24 15:28:28 by p01 p01
@p01 feel free to include it on github and to modify the script if needed.
if you publish it, could you add my email address near the signature ? eg : something like "2012.08.24 Tigrou (tigrou.ind at gmail.com)"

I dont think adding the jpeg extension is needed, since all 57000 pouet screenshots are png, jpg or gif only.
added on the 2012-08-24 16:39:53 by Tigrou Tigrou
I had a quick look and the images are served with an ETAG which makes the servers quite robust. Check this gist to see what I've got so far.

added on the 2012-08-24 16:50:43 by p01 p01
after adding opacity:0.25 to Kabuto's script so you actually get to see most of the screenshot as well prior to wanting to watch it as a video, it's really a nice feature now. thanks :)
also, minor but handy tweak: if you remove '#maindownload ~' from the script as well, it'll just take the latest mentioned youtube url from the comments as well. just in case it isnt yet added by gloperators in the download section at the top yet.

login