+/**
+ * @brief Search for GNU Social user with gstools.org
+ *
+ * @param str $search User name
+ */
+function gs_search_user($search) {
+
+ $a = get_app();
+
+ $url = "http://gstools.org/api/users_search/".urlencode($search);
+
+ $result = z_fetch_url($url);
+ if (!$result["success"])
+ return false;
+
+ $contacts = json_decode($result["body"]);
+
+ if ($contacts->status == 'ERROR')
+ return false;
+
+ foreach($contacts->data AS $user) {
+ $contact = probe_url($user->site_address."/".$user->name);
+ if ($contact["network"] != NETWORK_PHANTOM) {
+ $contact["about"] = $user->description;
+ update_gcontact($contact);
+ }
+ }
+}
+
+