Use PHPAPI to obtain weather forecasts and send them to friends. The API obtains weather forecasts, and uses the Apsara API to send text messages to friends and send scheduled tasks. This allows them to automatically send weather forecasts to themselves and their loved ones on a daily basis ...? Php ######### API to obtain weather forecasts and send text messages to friends using the Apsara API
With the scheduled task, you can automatically send weather forecasts to yourself and your loved ones on a daily basis...
5 & strtolower (substr ($ url, 0,5) = "https") {curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false);} if (is_array ($ postFields) & 0 <count ($ postFields) {$ postBodyString = ""; $ postMultipart = false; foreach ($ postFields as $ k => $ v) {if ("@"! = Substr ($ v, 0, 1) // determines whether the file is uploaded {$ postBodyString. = "$ k = ". urlencode ($ v ). "&";} else // multipart/form-data for file upload; otherwise, www-form-urlencoded {$ postMultipart = true ;}} unset ($ k, $ v); curl_setopt ($ ch, CURLOPT_POST, true); if ($ postMultipart) {curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ postFields);} else {curl_setopt ($ ch, CURLOPT_POSTFIELDS, substr ($ postBodyString, 0,-1); }}$ reponse = curl_exec ($ ch); if (curl_errno ($ ch )) {Throw new Exception (curl_error ($ ch), 0);} else {$ httpStatusCode = curl_getinfo ($ ch, CURLINFO_HTTP_CODE); if (200! ==$ HttpStatusCode) {throw new Exception ($ reponse, $ httpStatusCode) ;}} curl_close ($ ch); return $ reponse;} function object_to_array ($ obj) {$ _ arr = is_object ($ obj )? Get_object_vars ($ obj): $ obj; foreach ($ _ arr as $ key => $ val) {$ val = (is_array ($ val) | is_object ($ val ))? Object_to_array ($ val): $ val; $ arr [$ key] = $ val;} return $ arr ;}?>
With the help of scheduled tasks, you can continuously send weather forecasts to yourself and your loved ones on a daily basis... ? Php #########...