-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
41 lines (30 loc) · 975 Bytes
/
index.php
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
<?php
session_start();
require_once('instapaperxauth.php');
require_once('config.php');
// Create an Instapaper OAuth object with consumer key and consumer secret.
$connection = new InstapaperXAuth(CONSUMER_KEY, CONSUMER_SECRET);
// Make XAuth Request
$xcontent = $connection->getXAuthToken(XOAUTH_USERNAME,XOAUTH_PASSWORD);
echo $xcontent . "<br />";
// Pull Bookmarks
$limit = 10;
$folder_id = "";
$have = "";
$Bookmark_List = $connection->getBookmarks($limit,$folder_id,$have);
$Bookmarks = json_decode($Bookmark_List,true);
foreach($Bookmarks as $Bookmark)
{
if( $Bookmark['type']=='bookmark')
{
echo "type:" . $Bookmark['type'] . "<br />";
echo "bookmark_id:" . $Bookmark['bookmark_id'] . "<br />";
echo "title:" . $Bookmark['title'] . "<br />";
echo "url:" . $Bookmark['url'] . "<br />";
echo "<br />";
$Bookmark_Text = $connection->getBookmarkText($Bookmark['bookmark_id']);
echo $Bookmark_Text . "<br />";
echo "<br />";
}
}
?>