public
Description: GetSatisfaction.com's Helper Center
Clone URL: git://github.com/nullstyle/helpcenter.git
bring tags() into the caching framework
nullstyle (author)
Wed May 21 12:32:50 -0700 2008
commit  9309ee58030d72ca9921d0a7744f021ac4415281
tree    e4635e3e21c858bdc663afea1cefca33ec8b0874
parent  9a92b8f6527ca39d12e48c6c78c9aa9ad68fc8d9
...
454
455
456
457
458
 
 
459
460
461
...
454
455
456
 
 
457
458
459
460
461
0
@@ -454,8 +454,8 @@ $tags_cache = array();
0
 function tags($url) {
0
   global $tags_cache;
0
   if ($tags_cache[$url]) return $tags_cache[$url];
0
-
0
- $xml = simplexml_load_file($url); # FIXME: caching.
0
+ $raw = get_url($url);
0
+ $xml = simplexml_load_string($raw);
0
   $root_nodes = $xml->xpath("//*[@class='tag']");
0
   $tags = array();
0
   if ($root_nodes) {
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ require_once("Sprinkles.php");
0
 $sprink = new Sprinkles();
0
 
0
 $top_topic_tags = take(20,
0
- $sprink->tags('http://api.getsatisfaction.com/companies/' .
0
+ $sprink->tags($api_root . 'companies/' .
0
                     $sprink->company_sfnid .
0
                     '/tags?on=topics&sort=usage&limit=20'));
0
 
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ $suggested = $sprink->topics(array('query' => $subject, "limit" => $submit_sugge
0
 $suggested = $suggested['topics'];
0
 
0
 $top_tags = take(8,
0
- $sprink->tags('http://api.getsatisfaction.com/companies/' .
0
+ $sprink->tags($api_root . 'companies/' .
0
                     $sprink->company_sfnid .
0
                     '/tags?on=topics&sort=usage&limit=8'));
0
 

Comments

    No one has commented yet.