Search…

X3 Photo Gallery Support Forums

Search…
 
x-tremed
Topic Author
Posts: 20
Joined: 20 May 2011, 16:40

bit.ly pro

25 May 2011, 06:47

Is it possible to add the function of adding the api key of bit.ly ?
this way we can use our own bit.ly pro account with our own shortened domain linkservice.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: bit.ly pro

25 May 2011, 11:21

x-tremed wrote:Is it possible to add the function of adding the api key of bit.ly ?
this way we can use our own bit.ly pro account with our own shortened domain linkservice.
This is interesting, but how exactly would you use it? Where would the bit.ly link be provided by Imagevue?
 
x-tremed
Topic Author
Posts: 20
Joined: 20 May 2011, 16:40

Re: bit.ly pro

25 May 2011, 11:28

While using addthis you can add extra parameters to the script to use the bit.ly api key

more info at: http://www.addthis.com/help/client-api#url-transforms

hopefully this can be realised, especially for long domains this could be perfect
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: bit.ly pro

26 May 2011, 01:52

x-tremed wrote:While using addthis you can add extra parameters to the script to use the bit.ly api key

more info at: http://www.addthis.com/help/client-api#url-transforms

hopefully this can be realised, especially for long domains this could be perfect
Ok, this makes sense, although there are a few things that elude me ...

# AddThis by default already shortens URLs posted to twitter ...

# Many services, including big ones like Facebook, only display a truncated URL. They emphasize on the TITLE+DESCRIPTION of the page instead.

I am not sure where url shortening would have a huge effect. However, I see on their page that it would be quite easy to add. I found the following code on the page you provided:
Code
var addthis_share = {
    url_transforms : {
        shorten: {      
            twitter: 'bitly'
        },
    },
    shorteners : {
        bitly : { 
            username: 'your_username',
            apiKey: 'R_123456...'
        }
    }
}
Simply open and edit your file iv-includes/templates/index.gallery.phtml - You need to carefully add the data above into existing objects, so it would look something like this:
Code
	addthis_share = {
		templates: {twitter: '{{title}} - {{url}}'},
		url_transforms : {shorten: {twitter: 'bitly'}},
		shorteners : {bitly : { username: 'your_username', apiKey: 'R_123456...'}}
	}
Just insert your bit.ly username and API key. However, I am not quite sure what the shorten object under url_transforms does ... ? Do you have to add all the services where you want URL shortened here? Seems a bit tedious ... What happens if you remove this line? Perhaps it will shorten for ALL services? Would appreciate your reporting back if you proceed ...
 
x-tremed
Topic Author
Posts: 20
Joined: 20 May 2011, 16:40

Re: bit.ly pro

26 May 2011, 04:14

Thanks, I was allready searching in all the files for the addthis code but didn't find it ;)
wil give it a try this weekend.

As far as i know, only the Twitter linking trough Addthis supports linkshortening. Facebook for example needs the full URL to include a image on the facebookpage.
But i'll try it without the url_transforms variabel and let you know ;)