about summary refs log tree commit diff stats
path: root/update/library
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-07 18:30:50 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-07 18:30:50 +0000
commita7e5c508d476eb46d13d0c2fa40266c72f7c0ed4 (patch)
tree6c2532633150e81dff8ce2f96dd61cf11c298f08 /update/library
parent0fd7bd1ff56a6d5ba027ef0880aa25dd1bffc390 (diff)
downloadinstadisc-a7e5c508d476eb46d13d0c2fa40266c72f7c0ed4.tar.gz
instadisc-a7e5c508d476eb46d13d0c2fa40266c72f7c0ed4.tar.bz2
instadisc-a7e5c508d476eb46d13d0c2fa40266c72f7c0ed4.zip
Update: Added multiple subscription support
Closes #22
Diffstat (limited to 'update/library')
-rw-r--r--update/library/trunk/instadisc.php38
-rw-r--r--update/library/trunk/subscription.php12
2 files changed, 33 insertions, 17 deletions
diff --git a/update/library/trunk/instadisc.php b/update/library/trunk/instadisc.php index 8405110..fc3ac08 100644 --- a/update/library/trunk/instadisc.php +++ b/update/library/trunk/instadisc.php
@@ -4,24 +4,25 @@
4 4
5include('xmlrpc/xmlrpc.inc'); 5include('xmlrpc/xmlrpc.inc');
6 6
7$idusUsername = ''; // Set this to the username you've registered 7$idusUsername = array();
8$idusPassword = ''; // Set this to the password you've registered 8$idusPassword = array();
9$idusCentralServer = ''; // Set this to the Central Server you've signed up with 9$idusCentralServer = array();
10$idusSubscriptionURI = ''; // Set this to your unique URI 10$idusSubscriptionURI = array();
11$idusSubscriptionTitle = ''; // Set this to your Subscription's title 11$idusSubscriptionTitle = array();
12$idusSubscriptionCategory = ''; // Set this to the category your subscription uses 12$idusSubscriptionCategory = array();
13$idusActivationKey = ''; // See http://fourisland.com/projects/instadisc/wiki/Update/Library 13$idusActivationKey = array();
14$instaDisc_subCount = 0;
14 15
15function instaDisc_sendItem($title, $author, $url, $semantics) 16function instaDisc_sendItem($id, $title, $author, $url, $semantics)
16{ 17{
17 global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI; 18 global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI;
18 $verID = rand(1,65536); 19 $verID = rand(1,65536);
19 20
20 $client = new xmlrpc_client($idusCentralServer); 21 $client = new xmlrpc_client($idusCentralServer[$id]);
21 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($idusUsername, 'string'), 22 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($idusUsername[$id], 'string'),
22 new xmlrpcval(md5($idusUsername . ":" . md5($idusPassword) . ":" . $verID), 'string'), 23 new xmlrpcval(md5($idusUsername[$id] . ":" . md5($idusPassword[$id]) . ":" . $verID), 'string'),
23 new xmlrpcval($verID, 'int'), 24 new xmlrpcval($verID, 'int'),
24 new xmlrpcval($idusSubscriptionURI, 'string'), 25 new xmlrpcval($idusSubscriptionURI[$id], 'string'),
25 new xmlrpcval($title, 'string'), 26 new xmlrpcval($title, 'string'),
26 new xmlrpcval($author, 'string'), 27 new xmlrpcval($author, 'string'),
27 new xmlrpcval($url, 'string'), 28 new xmlrpcval($url, 'string'),
@@ -29,4 +30,17 @@ function instaDisc_sendItem($title, $author, $url, $semantics)
29 $client->send($msg); 30 $client->send($msg);
30} 31}
31 32
33function instaDisc_addSubscription($username, $password, $central, $uri, $title, $category, $key = '')
34{
35 global $instaDisc_subCount, $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI, $idusSubscriptionTitle, $idusSubscriptionCategory, $idusActivationKey;
36 $idusUsername[$instaDisc_subCount] = $username;
37 $idusPassword[$instaDisc_subCount] = $password;
38 $idusCentralServer[$instaDisc_subCount] = $central;
39 $idusSubscriptionURI[$instaDisc_subCount] = $uri;
40 $idusSubscriptionTitle[$instaDisc_subCount] = $title;
41 $idusSubscriptionCategory[$instaDisc_subCount] = $category;
42 $idusActivationKey[$instaDisc_subCount] = $key;
43 $instaDisc_subCount++;
44}
45
32?> 46?>
diff --git a/update/library/trunk/subscription.php b/update/library/trunk/subscription.php index 7e05f5b..863c30c 100644 --- a/update/library/trunk/subscription.php +++ b/update/library/trunk/subscription.php
@@ -4,13 +4,15 @@
4 4
5include('instadisc.php'); // Make sure that if you move me away from instadisc.php that you update this include! 5include('instadisc.php'); // Make sure that if you move me away from instadisc.php that you update this include!
6 6
7echo('Subscription: ' . $idusSubscriptionURI . "\n"); 7$id = (isset($_GET['id']) ? $_GET['id'] : 0);
8echo('Title: ' . $idusSubscriptionTitle . "\n");
9echo('Category: ' . $idusSubscriptionCategory . "\n");
10 8
11if ($idusActivationKey != '') 9echo('Subscription: ' . $idusSubscriptionURI[$id] . "\n");
10echo('Title: ' . $idusSubscriptionTitle[$id] . "\n");
11echo('Category: ' . $idusSubscriptionCategory[$id] . "\n");
12
13if ($idusActivationKey[$id] != '')
12{ 14{
13 echo('Key: ' . $idusActivationKey . "\n"); 15 echo('Key: ' . $idusActivationKey[$id] . "\n");
14} 16}
15 17
16?> 18?>