aboutsummaryrefslogtreecommitdiffstats
path: root/mod/knownhubs.php
blob: 9993d8e50a9045b2b9c55538da9890e27bb14a5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
	}
	
}