PHP - Yahoo Weather Api Translation
Hello,
For months I'm looking for a weather script for my modest blog I finally have a php script that displays yahoo weather (5 days) in English (TUE, WEN, THU, ...) It would be nice if someone can tell me if there is a way, function or script, to translate these days in French Yahoo team says that it is not possible :http://developer.yahoo.com/forum/General-Discussion-at-YDN/Can-Yahoo-Weather-API-show-by/1275022713000-d78748d9-0247-313b-ad9e-3503b8ea3d07 Cordially, Kim. Similar TutorialsHey guys I'm after a English to Arabic translation script...although I have Googled it but as you can imagine there's no script of that. Would I have to create a array of English words and then give them the value in Arabic? :/...just wondering if I have any other options...thank you I'm having some trouble working on a site that i started a few years ago. I'm basically relearning how it was working, or not working. I've been able to figure out most, but I've come across something that I'm not finding online. What is the purpose of this $i here? Code: [Select] $catSQL = "SELECT * from category"; $stSQL = mysql_query($catSQL) or die ("<br><font color='red'><b>There was a problem!</b></font><br><br>" . mysql_error()); while ($i < mysql_num_rows($stSQL)) { $catname=mysql_result($stSQL,$i,"name"); $catid=mysql_result($stSQL,$i,"id"); $categoryDropdown .= "<option value=".$catid.">".$catname."</option>"; ++$i; } I don't get it...every other day but Sunday is shows up correct? $VDOP = "2011-12-04"; $exp = explode("-", $VDOP); echo "$VDOP is on a " .date("l", mktime(0, 0, 0, $exp[2], $exp[1], $exp[0])); Any thoughts on this (besides Jesus doesn't like PHP ). I hope someone can help me with this one. I have tried all sorts of different methods and I can't seem to get the syntax correct. The application is calling a program called ZP4, a database used for address scrubbing, using COM. From their documentation: Quote ZP4IPCOM exposes a simple interface of four different calls: Input, Correct, Output, and Reset. "Input" is used to pass address input to ZP4... "Correct" is used to make ZP4 search the ZIP+4 database for the previously specified input address. "Output" retrieves a ZP4 output field. The COM example they give in the documentation uses VB. The VB code executes as it should without problems but everything I try with PHP issues an error: Here is the VB code straight from their documentation, which executes correctly. Code: [Select] Set zp4 = CreateObject("ZP4IPCom.ZP4Com") zp4.input "Company", "xyz corp" zp4.input "Address", "box 1920" zp4.input "City", "rio del mar" zp4.correct MsgBox zp4.output("ZIP (final)") Set zp4 = Nothing Here is my attempt at the translation to PHP, which issues an error (Method not found for 3 of the 4 methods) Code: [Select] $zp4 = new COM('ZP4IPCom.ZP4Com'); $zp4->reset; $zp4->input("Company", "xyz corp"); $zp4->input("Address", "box 1920"); $zp4->input("City", "rio del mar"); $zp4->correct; $output = $zp4->output("ZIP (final)"); echo $output; $zp4 = null; It's strange because the output method is found, because the results will be displayed on the program's server log window, but the other 3 methods are not found (input, reset, and correct). Any help with this would be greatly appreciated! anyone have experience integrating the WeatherBug API and PHP to pull data? Specifically I want to pull zip code from a MySQL DB and integrate with the API to display the weather for a specific zip code based location. Hi, I'm trying to get weather from google. it is working fine on my local machine. but when i make the page live it starts giving error as follow: Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Warning: simplexml_load_file(http://www.google.com/ig/api?weather=dubai): failed to open stream: no suitable wrapper could be found in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.google.com/ig/api?weather=dubai" in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 9 Fatal error: Call to a member function xpath() on a non-object in /vhost/vhost10/d/x/b/dxbconnect.com/www/demo/weather.php on line 10 can anyone help please? This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=326509.0 Hi, I am trying to translate a page in PHP using Google API. There is 5000 chars limit on data that you can send to Google at a time. So I am trying to break the page into pieces of 5000 chars. But as you know while doing this we have to keep in mind the HTML formatting that it should not be disturbed otherwise you will not get desired results. For example you have to send this: <a href="#" class="myclass">Link</a> Instead of this: <a href="#" class="myclas I am able to solve it somehow (although not perfectly I guess) by checking if "<" sign is coming after ">" sign or not. If "<" sign is coming after ">" then I go back to the point where I found ">" and cut string from there. Anyway the point is I am still having some problems regarding HTML formatting and want to know how to do it efficiently. Is there any parser available that will solve this problem!? Thanks Good Day guys
I need some help with something that I am busy with. I have a wallpaper that need to get weather effects on it but it has to be according to the current weather status and time. The wallpaper is in the attached. I have searched the net the whole day now and cant find what I am looking for.
Let me give an example:
If it rains the background wallpaper must have the rainy look and be wet, when its sunny there need to be a sun and the background must be brighter.
Please help me with this.
Attached Files
bg.jpg 127.22KB
0 downloads how could I get the next days forecasted high and low temp from this feed into php variables? feed://view/1292654647//http://newsrss.bbc.co.uk/weather/forecast/2818/Next3DaysRSS.xml any help appreciated. thanks in advance. Hi every one I've downloaded some classes but they weren't work . How do I send a private message? thanks If your working with Yahoo API, or Yahoo Scraping, is there a way to detect the 999 error. I have an App that deals heavily with Yahoo scraping. However, Yahoo after awhile has the 999 error. What I want to do is detect when it returns the error, serialize all the arrays up into a database, and allow the client to try it again later when Yahoo has removed it's blocking restriction (after about an hour). So, what I have thought about is doing a standard detection script. Just to see if the text 999 was found. SO the function that I use to get data from Yahoo, after awhile it returns: Quote Warning: file_get_contents(http://siteexplorer.search.yahoo.com/search?p=http://http://www.seomarketing.com&bwm=i&bwmf=u&bwms=p&fr2=seo-rd-se&b=1501) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 999 Unable to process request at this time -- error 999 in /var/www/vhosts/seomarketing.com/httpdocs/seotools/competitiveanalysis/functions.php on line 86 What I want to do is supress that error (Which I can do with Error Reporting, or the @ symbol. That is easy. What I also want to do is put up a conditional. if (file_get_contents($url) throws a warning) { // Do some database work. } I can't figure out the best way to approach this. Any advice? I am having problems being able to find the data that needs to be posted in various translation websites. I think this is because the translation tools they have are using some kind of flash script to translate? So the new page isn't being loaded using the post data string?? I am not completely sure, anyways... I am using live http headers on firefox to try and get the content for the post data string. The sites I have tried to get the post data from are these: http://www.freetranslation.com/ http://www.free-translator.com/ I can get cURL to visit the page and do everything, I just cant find the post data string. or maybe I am way off here.. Thanks for any help Hey guys, newbie here love the site, lots of great info, hopefully one of u guys can help me out. i have adapted code from http://www.singhvishwajeet.com/2009/06/25/using-php-to-get-stock-quotes-from-yahoo-finance/ (which is free to use) i have been working on a way to enter a company code, e.g. BARC -barclays bank, on one page then on another im trying to serahc the yahoo csv for a number of specific numbers that are "live" and then output them on my site, which in turn i shall work with but i cant seem to out put the data, its the $stat bit im struggling with i will attach the files, hopefully someone can help me Hello, everyone. I'm still kind of new at this, so please bear with me. I've customized a website (hosted by Yahoo Small Business) which is now fully functional aside from the "Contact Us" page. I have a PHP file named "send_email.php" uploaded to my root directory which has the following code: <?php $contact_name = $_POST['name']; $contact_email = $_POST['email']; $contact_subject = $_POST['subject']; $contact_message = $_POST['message']; if( $contact_name == true ) { $sender = $contact_email; $receiver = "my@email.com"; $client_ip = $_SERVER['REMOTE_ADDR']; $email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\nFlash Contact Form provided by http://www.flashmo.com"; $extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion(); if( mail( $receiver, "Flash Contact Form - $contact_subject", $email_body, $extra ) ) { echo "success=yes"; } else { echo "success=no"; } } ?> I went ahead and changed "my@email.com" to my actual email address. The problem I'm having, though, is that the form fails every time...except if I enter my own email address in the "Email" field which should be filled in by the customer. I can't figure this out. It's probably something simple that I'm doing wrong, or perhaps it has something to do with Yahoo Web Hosting. I'm also thinking I have to fill something in the "Client IP" section of the code...but I'm not sure what should go there. I'd really appreciate your time and responses. Thanks so much. It seems something has changed at Yahoo Finance. I use a Stock quote script (micro stock) to post stock quotes from specific tickers on my website. It worked fine for years until recently. Now i am unable to access any data directly from any Yahoo finance URL. Hereafter my script which comes from 1) Micro Stock : http://www.phptoys.com/product/micro-stock.html or 2) Getting Stock Quote : http://www.phptoys.com/tutorial/getting-stock-quote.html <?php function getStockSite($stockLink){ if ($fp = fopen($stockLink, 'r')) {$content = ''; while ($line = fread($fp, 1024)) {$content .= $line;}} return $content;} function processStockSite($wurl){ $wrss = getStockSite($wurl); $text = ''; if (strlen($wrss)>100){ // Get text $spos = strpos($wrss,'</span>:',$spos)+3; $spos = strpos($wrss,'<big>',$spos); $epos = strpos($wrss,'</div><h1>',$spos); if ($epos>$spos){ $text = substr($wrss,$spos,$epos-$spos);} else {$text = '-';}} // Get results $result['text'] = $text; return $result;} <html> <head> <title>Get Stock tutorial</title> </head> <body> <?php // Get stock data $data = processStockSite('http://finance.yahoo.com/q?s=GOOG'); echo $data['text']; ?> I am not php programmer and i hope someone can help me in this matter since that script was a marvel. Thank in advance. I'm using a simple form to grab an email address and send the person who signs up and automatic response. It was working for a while and now it's not. Not sure what happened. My hosting company told me to look into my headers. Can anyone help? Here is my code. Thanks, Code: [Select] <?php /* Set e-mail recipient */ $subject = "Sign Up"; $headers = "From: admin@xxx.com" . "\r\n" . "CC: admin@xxx.com"; /* Check all form inputs using check_input function */ $sign_up_email_address = check_input($_POST['sign_up_email_address'], "Please enter your email address."); /* If e-mail is not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $sign_up_email_address)) { show_error("E-mail address not valid"); } /* Let's prepare the message for the e-mail */ $response_message = "Sample Message"; /* Send the message using mail() function */ mail($sign_up_email_address, $subject, $response_message, $headers); /* Functions we used */ function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem && strlen($data) == 0) { show_error($problem); } return $data; } function show_error($myError) { ?> <?php echo $myError; ?> Thank you, Hello ive Googled around for ages for a PHP script that Shows the yahoo user statuts .. but the only thing i ve found is this link from yahoo thats saying the Online/Offline statuts http://opi.yahoo.com/online?u= ive heared that theres some way of sending a bot to the id and see if its on invisible .. dos anyone know a way to do it ? Hello all, I'm looking for some assistance with some code. I'm trying to put this to bed as it's driving me nuts. The Psuedo code for this would be to 1) Download the rates from the Yahoo API and declare my base rate to my foreign exchange. 2) Store an array of currencies to choose from to compare against the base currency. 3) I then GET the chosen currency and register it in a SESSION to be used on other pages. (I'm unsure if this is correct?) 4) I then calculate the Price of my product which is in GBP to the selected foreign currency. 5) Output the converted price anywhere on the page. My script takes GET values from the URL like so.. .com?c=EUR My code is like so.. 1) First I get the rates from the Yahoo API Code: [Select] session_start(); $from = 'GBP'; $to = '$c'; $url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $from . $to .'=X'; $handle = @fopen($url, 'r'); if ($handle) { $result = fgets($handle, 4096); fclose($handle); } $allData = explode(',',$result); /* Get all the contents to an array */ $PoundValue = $allData[1]; 2) Then I store an array of the currencies. Code: [Select] $currency_array = array ('USD','EUR','RMB','JPY','AUD','CHF') 3) Then I get the chosen currency. Code: [Select] if(isset($_GET['c'])) { $c = $_GET['c']; if(array($currency_array)) { $_SESSION['currency_array'] = $c; } } 4) I then calculate the product price. Code: [Select] $Total = $Price * $currency_array; $outprice = number_format($Total, 2, '.', ','); 5) Then I output on the page Code: [Select] <?php echo .$outprice; ?> So is all my coding logically in the right order? Any help would be greatly appreciated. Thank you. |