-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
57 lines (45 loc) · 1.32 KB
/
Copy pathtest.php
File metadata and controls
57 lines (45 loc) · 1.32 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Test</title>
</head>
<body>
<?php
require_once('lib/bitly.class.php');
include('config.php');
$bitly = new Bitly($login, $apiKey);
$bitly->setReturnFormat('xml');
try {
$bitly->error();
} catch (Exception $e) {
echo '<div>' . $e->getMessage() . '</div>';
}
$url = $bitly->shortenSingle('http://www.ruslanas.com');
//$bitly->setReturnFormat('xml');
//echo $bitly->stats($url);
//exit;
// line below generates error
try {
$bitly->getThumbnail();
} catch(Exception $e) {
echo '<div>' . $e->getMessage() . '</div>';
}
$bitly->getInfoArray($url);
$bitly->getStatsArray($url);
echo '<h1>' . $bitly->getTitle() . '</h1>';
echo $bitly->getClicks() . ' clicks<br/>';
echo '<img src="' . $bitly->getThumbnail('medium') . '"/>';
echo '<h2>Expanded data</h2>';
echo 'Expanded: ' . $bitly->expandSingle($url);
include('lib/zzgd.class.php');
$zzgd = new Zzgd();
$short = $zzgd->shortenSingle('http://www.google.com/');
echo '<br/>zz.gd: ' . $short;
echo '<br/>Decrypted: ' . $zzgd->expandSingle($short);
include('lib/tinyurl.class.php');
$tinyurl = new Tinyurl();
$short = $tinyurl->shortenSingle($url);
echo '<br/><a href="' . $short . '">' . $short . '</a>';
?>
</body>
</html>