From: Evan Prodromou Date: Tue, 26 Apr 2011 20:16:10 +0000 (-0400) Subject: script to determine site nickname by domain X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=260f6ccdf24e69a6d37b4f067c334ab25f53ff25;p=quix0rs-gnu-social.git script to determine site nickname by domain --- diff --git a/plugins/EmailRegistration/scripts/sitefordomain.php b/plugins/EmailRegistration/scripts/sitefordomain.php new file mode 100644 index 0000000000..80fa6375e0 --- /dev/null +++ b/plugins/EmailRegistration/scripts/sitefordomain.php @@ -0,0 +1,52 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); + +$helptext = << +Prints site information for the domain given + +END_OF_SITEFORDOMAIN_HELP; + +require_once INSTALLDIR.'/scripts/commandline.inc'; + +$raw = $args[0]; + +$parts = explode('@', $raw); + +if (count($parts) == 1) { + $domain = $parts[0]; +} else { + $domain = $parts[1]; +} + +$domain = strtolower(trim($domain)); + +$snt = Status_network_tag::withTag('domain='.$domain); + +while ($snt->fetch()) { + $sn = Status_network::staticGet('site_id', $snt->site_id); + if (!empty($sn)) { + print $sn->nickname."\n"; + } +}