forked from hannesmannerheim/qvitter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshortener.php
More file actions
28 lines (19 loc) · 916 Bytes
/
shortener.php
File metadata and controls
28 lines (19 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/*
This is an example file of how you can utilise http://qttr.at/yourls-api.php URL shortener service from a GNUSocial instance, which is using https.
If you run the qvitter code «as is» the browser will stop you from communicate to qttr.at which is currently running http protocol.
This «proxy» return the result from http://qttr.at/yourls-api.php
1) Install this file on your website eg. : https://myinstance.net/shortener.php
2) Change the following in QvitterPlugin.php - settings() function
$settings['urlshortenerapiurl'] = 'https://yoursite.net/shortener.php';
3) Test it
Contact Knut Erik if you have any questions related to this .php file.
Quitter.no => knuthollund@quitter.no
GitHub: => https://github.com/fxdwg
*/
$query = $_SERVER['QUERY_STRING'];
if(strlen($query)>0) {
$shortenerUrl = 'http://qttr.at/yourls-api.php?' . $query;
print file_get_contents($shortenerUrl);
}
?>