google-code-export / hotot

Automatically exported from code.google.com/p/hotot
0 stars 0 forks source link

Hotot Short Url Extension #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

My two cents: http://github.com/xoan/org.hotot.shorturl

It's a simple dialog to configure custom shortener URL. No predefined services 
at this moment, sorry.

So, now you can use your own bit.ly, kcy.me, or another service credentials.

Original issue reported on code.google.com by xoansamp...@gmail.com on 24 Oct 2010 at 11:14

GoogleCodeExporter commented 9 years ago
Hey xoansampainho, you did a really nice work for hotot, which i wanna do but 
don't have enough time.

Many shorturl services need not only a url but also an api key to work. I 
appreciate you work, and it's can be better if you can complete the extension. 
So you can be the 1th third-part extension author of Hotot.

Original comment by 5h3l...@gmail.com on 25 Oct 2010 at 2:53

GoogleCodeExporter commented 9 years ago
Thank you :)

I've found a problem to continue: your $('#btn_shorturl').click() function 
assumes that the shortener url service responds in JSON format with a data.url 
value, but some services, like is.gd or tinyurl don't do that.

I suppose that I can rewrite the function, but I can't figure out how to 
replace (unbind when extension is loaded and bind again when extension is 
unloaded) this function, because it does not have a namespace.

By the way, I think that the right response when custom url is used should be 
plain text, to be generic; for predefined services this is not relevant, 
because we control the response data received.

Maybe, entirely shorturl code from hotot can be moved to the extension?

Thanks again, and thanks for the best twitter client ;)

Original comment by xoansamp...@gmail.com on 25 Oct 2010 at 10:23

GoogleCodeExporter commented 9 years ago
Hi Xoan,

The API of extension are not ready to be public so far. I hope the API can be 
available in the first stable version 0.9.9, though there are many work should 
be done.

And thank for your support:)

Original comment by 5h3l...@gmail.com on 25 Oct 2010 at 10:36

GoogleCodeExporter commented 9 years ago
Hi!

Version 1.1 is out. I think it's enough functional :)

There is a lot of crufty and duplicate code, and maybe a solution using RegExp 
to make service_url would be more simple, but I'm not a professional programmer 
(it's only a hobby ;)

Original comment by xoansamp...@gmail.com on 27 Oct 2010 at 5:37

GoogleCodeExporter commented 9 years ago
Hi Xoan, 

I make some changes to make shorturl button available after extension is 
unloaded:
{{{

--- entry.js    2010-10-28 08:45:33.000000000 +0800
+++ entry.js_   2010-10-28 09:54:29.000000000 +0800
@@ -191,12 +191,14 @@
         ext.HototShortUrl.set_service_url(val);
     });
     $('#btn_shorturl').unbind('click').bind(
-        'click', ext.HototShortUrl.on_btn_short_url_clicked).show();
+        'click', ext.HototShortUrl.on_btn_short_url_clicked);
 },

 unload:
 function unload() {
-    $('#btn_shorturl').unbind('click').hide();
+    $('#btn_shorturl').unbind('click').bind(
+        'click', ui.StatusBox.on_btn_short_url_clicked);
+
 },

 options:

}}}

I will submit your code to source repository. Thank you for your excellent work 
:)

Original comment by 5h3l...@gmail.com on 28 Oct 2010 at 2:20

GoogleCodeExporter commented 9 years ago
Great!

I couldn't because "main" click event wasn't bind to a function, and the first 
solution was hide the button. Thanks for changes in your source code and thanks 
for the diff --I'll commit now :)

And thanks for merging :D

Original comment by xoansamp...@gmail.com on 28 Oct 2010 at 7:47

GoogleCodeExporter commented 9 years ago
I've seen that your diff isn't applied in your main repository: 
http://code.google.com/p/hotot/source/browse/data/ext/org.hotot.shorturl/entry.j
s#199 (code is the same as mine :)

Original comment by xoansamp...@gmail.com on 3 Nov 2010 at 9:44

GoogleCodeExporter commented 9 years ago
OMG... my fault

Original comment by 5h3l...@gmail.com on 3 Nov 2010 at 1:04