• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

How can I get chevereto to work with tiny.im

Status
Not open for further replies.

brightboss

Chevereto Member
I know you can add a custom short url service in chevereto's config. I'm puzzled... tiny.im shows how to integrate to their api here http://tiny.im/api.html But I don't know what and how to make it work for chevereto. Is their any code genius that can help? Thanks.
 
This is the format for Chevereto:
Code:
http://yoursite.com/yourls-api.php?format=simple&action=shorturl&username=<USERNAME>&password=<PASSWORD>&url=

But you can't do it directly because tiny.im requires a base64 string and a .json ending. My sugesstion is to add tiny.im in the Chevereto shorturl class.
 
I'm not a coder... so I wouldn't know how to add it as a class. I wish I did. Is it possible you can show me the code to add to make it work?
 
hmmm the only easy fix will be to create a sub-api in Chevereto. Something like mysite.com/shorturl-api.php and that make compatible with Chevereto, inside this file the system will mimic the valid format. Please send me API details to test and perhaps I can make it for you.

Cheers,
 
There is the bridge:

PHP:
<?php
/* Tiny.im bridge for Chevereto */
/* By Rodolfo Berrios */
 
define('access', 'BRIDGE');
require_once('includes/chevereto.php');
 
$config['tinyim_api_key'] = 'YOUR API KEY GOES HERE'; // Ypur tini.im API key
$tinyim = json_decode(fetch_url('http://tiny.im/api/v1/'.$config['tinyim_api_key'].'/shorturl/create/url/'.base64_encode($_GET['url']).'.json'));
 
die($tinyim->data->short_url);
 
?>

Put that file in the root of your Chevereto installation, put any name on it like tinyim_bridge.php.

Then in includes/config.php go to $config['short_url_service'] and set "custom". Then in $config['custom_short_url_api'] should look like this:

PHP:
$config['custom_short_url_api'] = 'http://mycheveretoinstallation.com/tinyim_bridge.php?url='

Cheers,
 
enable error reporting to see what is missed in the bridge.
 
Status
Not open for further replies.
Back
Top