Alfred-Workflows icon indicating copy to clipboard operation
Alfred-Workflows copied to clipboard

add https://0cn.de to short url list

Open ryanthara opened this issue 8 years ago • 4 comments

Hello

is it possible to add the service https://0cn.de to shorten url?

The service provides privacy...

ryanthara avatar May 05 '16 07:05 ryanthara

A API is needed if you want to use this service with workflow.

hzlzh avatar May 06 '16 17:05 hzlzh

I'll ask the author for an api, but he hasn't answered yet.

0cn.de has the ability to save the service as bookmarks, and you will see the code behind.

javascript:(function()%7Bvar%20d=false;%20var%20n_u=navigator.userAgent;%20if(location.protocol=='https:'%20&&%20(n_u.indexOf('Chrome')!=-1%20%7C%7C%20n_u.indexOf('Opera')!=-1))%7Bwindow.open('https://0cn.de/?url='+encodeURIComponent(document.URL)+'&noref=1',%20'_blank');%20d=true;%7D%20if(!d)%7Bvar%20d=document,s=d.createElement('script');s.charset='UTF-8';s.type='text/javascript';s.src='https://0cn.de/js/bookmark.php?s=0.2&noref=1&url='+encodeURIComponent(d.URL);d.body.appendChild(s);%7D%7D)();

Is this helpful?

ryanthara avatar May 06 '16 18:05 ryanthara

Yes, this should be a kind of API:

https://0cn.de/js/bookmark.php?s=0.2&noref=1&url=google.com

and you can get the final short link this.

var nr='&noref=1';if (null==prompt("Hier die gewünschte Kurz-URL. Kopiere sie und klicke 'OK', wenn du zufrieden bist. Klicke auf 'Abbrechen', um weitere Einstellungen auf 0cn.de vorzunehmen (falls nichts passiert: Pop-Up zulassen).", "http://0cn.de/qfzu")){ window.open('https://0cn.de/?url='+encodeURIComponent(document.URL)+nr, '_blank'); }

hzlzh avatar May 07 '16 10:05 hzlzh

Looks good. But my skills are so bad, I failed with an implementation. :-(

ryanthara avatar Oct 22 '17 09:10 ryanthara