aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Tacconi <p.tacconi@giunti.it>2014-09-30 12:24:49 +0200
committerPaolo Tacconi <p.tacconi@giunti.it>2014-09-30 12:24:49 +0200
commit018f1b813cffaef849652a7d287169f01defef68 (patch)
tree99e87f95c80459086a67ce21e3614e1d6ab07774
parentcef570991a7ac43b8dbd4b48b900a33dfe2b8f9c (diff)
downloadvolse-hubzilla-018f1b813cffaef849652a7d287169f01defef68.tar.gz
volse-hubzilla-018f1b813cffaef849652a7d287169f01defef68.tar.bz2
volse-hubzilla-018f1b813cffaef849652a7d287169f01defef68.zip
Added mod returning a list of known hubs, for a lightweight hub crawler
-rw-r--r--mod/knownhubs.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/knownhubs.php b/mod/knownhubs.php
new file mode 100644
index 000000000..9993d8e50
--- /dev/null
+++ b/mod/knownhubs.php
@@ -0,0 +1,22 @@
+<?php
+
+function knownhubs_init(&$a) {
+
+ if ($a->argv[1]=="json"){
+ $known_hubs = array();
+ $r = q("SELECT s.site_url FROM site as s group by s.site_url");
+
+ if(count($r)) {
+ foreach($r as $rr) {
+ $known_hubs[] = $rr['site_url'];
+ }
+ }
+ sort($known_hubs);
+
+ $data = Array(
+ 'knownhubs' => $known_hubs,
+ );
+ json_return_and_die($data);
+ }
+
+}