2012-08-27 31 views
11

マイクロソフトは天気予報APIをGoogleと非常によく似ています(現在は完全に死んでいるようです)。アプリケーションの1つをフィードに変換しましたが、すべての気象条件のリストを見つけることができませんでした。条件のMSN天気APIのリスト?

これはGoogleの天気APIについてはかなり詳しく説明されていますが、MSN天気APIの条件のリストは見つかりません。

FWIW、例のURL MSNを使用してデータを取り戻すためには、次のとおりです。

http://weather.service.msn.com/data.aspx?weadegreetype=F&culture=en-US&weasearchstr=Chicago,IL (サービスは利用できませんもう(2016年1月))

誰もが可能な条件でいくつかの光を当てることができますか?条件テキストをアイコンに変換できるように、それらが必要です。

+0

から入手できますか?私はそれを使用し、約15のiPhoneアプリを持っているし、今私は、ユーザーの不満と悪いレビューが殺到しています –

+0

これまでのところ、私は残念ながら2013年 –

+0

@SamBuddaの11月までの死のために予定されていないのiGoogleで使用されているGoogleの天気予報API読んだものあたかもGoogle天気予報APIがうまくいっていないかのように見えます。 iGoogleからの移行の一部であることは間違いありません(私も個人的に使用しました)。私は、Googleの天気APIに依存しているので、もう役に立たないGoogle Sitesウィジェットを持っています。 API以来 は、私たちがGoogleからの公式の応答を聞く疑う文書化されていません。私が知ることから、マイクロソフトのAPIも文書化されていないので、警告なしに消え去る可能性もあると思います。 –

答えて

16

私はわずかに異なるルートを移動し、XMLから(skycodeskycodeday)を提供し、アイコンに基づく条件を把握することを決めました。

ここに私が思いついたもののリストがあります。うまくいけば、それはGoogleの天気予報APIからの移行では他人のために役に立ちます。

  • 0、1、2、3、4、17、35 - 雷雨
  • 5 - 雨/雪ミックス
  • 6 - みぞれ/雪混合
  • 7 - 雨/雪/みぞれ混合
  • 8,9 - アイシー
  • 10 - レイン/みぞれ混合
  • 11 - 小雨
  • 1 2 - 雨
  • 13 - ライト雪
  • 14,16,42,43 - 雪
  • 15 - ブリザード
  • 18,40 - シャワー
  • 19 - ダスト
  • 20 - 霧
  • 21 - ヘイズ
  • 22 - 煙
  • 23,24 - ウィンディ
  • 25 - 極寒
  • 26 - 曇り
  • 27,29,33 - 曇り(夜)
  • 28,30,34 - 曇
  • 31 - クリア(夜)
  • 32 - クリア
  • 36 -
  • 37,38ホット - 散在雷雨
  • 39 - 散在シャワー
  • 41 - 散在雪のシャワー
  • 44 - N/
  • 45 - 散在レインシャワー(夜)
  • 46 - 散在雪のシャワー(夜)
  • 47 - 散在雷雨(夜)
+0

また、私はこの散乱シャワーをした私の目的のために、MSN天気予報API「シャワー/クリア」 –

+0

@SamBuddaでこれを見ました。あなたはそれを鉛筆と呼びますが、私はそれを筆記用具と呼んでいます。 ;-) –

4

ここで簡単に、私の機能ですお使いのGoogle APIコードは、MSNのAPIに変換:

function skycode2image ($skycode) 
{  

$daynight = "na"; 

$skycodes = array ( 
0 => 'thunderstorm', 
1 => 'thunderstorm', 
2 => 'thunderstorm', 
3 => 'thunderstorm', 
4 => 'thunderstorm', 
5 => 'rain_snow', 
6 => 'sleet', 
7 => 'rain_snow', 
8 => 'icy', 
9 => 'icy', 
10 => 'rain_snow', 
11 => 'showers', 
12 => 'rain', 
13 => 'flurries', 
14 => 'snow', 
15 => 'snow', 
16 => 'snow', 
17 => 'thunderstorm', 
18 => 'showers', 
19 => 'dust', 
20 => 'fog', 
21 => 'haze', 
22 => 'haze', 
23 => 'windy', 
24 => 'windy', 
25 => 'icy', 
26 => 'cloudy', 
27 => 'mostly_cloudy', 
28 => 'mostly_cloudy', 
29 => 'partly_cloudy', 
30 => 'partly_cloudy', 
31 => 'sunny', 
32 => 'sunny', 
33 => 'mostly_sunny', 
34 => 'mostly_sunny', 
35 => 'thunderstorm', 
36 => 'hot', 
37 => 'chance_of_tstorm', 
38 => 'chance_of_tstorm', 
39 => 'chance_of_rain', 
40 => 'showers', 
41 - 'chance_of_snow', 
42 => 'snow', 
43 => 'snow', 
44 => 'na', 
45 => 'chance_of_rain', 
46 => 'chance_of_snow', 
47 => 'chance_of_tstorm'); 

$condition = $skycodes[$skycode]; 

if (in_array($skycode,array(27,29,31,33,31,45,46,47))) $daynight = 'night'; 
if (in_array($skycode,array(28,30,32,34,36,37,38,39,41))) $daynight = 'day'; 

return array($condition,$daynight); 

} 
0

我々はそれがWIL意味、マイクロソフト天気APIは、もはやダウンロードできなくなりますし、2015年4月15日の時点で廃止されることを通知するように書いています私はもはや天気データを提供しません。したがって、現在使用している製品やアプリケーションからMicrosoft Weather APIを削除してください。ここで

を使用すると、代替天気APIを得ることに興味を持っている場合は、あなたのニーズをサポートすることができるかもしれない外部プロバイダのリストです:

http://api.accuweather.com/ 
http://www.wunderground.com/weather/api/d/pricing.html 
https://developer.forecast.io/ 

免責:Microsoftとマイクロソフト天気が提携、または任意に関連付けられていませんどのような方法で上記の会社の。

は、マイクロソフトに問題があるたびに行く誤報がたくさんだと思われる マイクロソフト天気チーム

+0

サービスは継続されましたか?私はまだAPIを呼び出すことができます – thatsIch

1

ありがとうございました。 私は今日MSN天気APIをテストしていました。そしてそれは戻った。 1時間ごとに気象データを返しています。

私は、以下の[おそらく非標準]クエリ今作られた:それは4月、2016年だし、それがどのように見える

<weatherdata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><weather weatherlocationcode="wc:USNY0309" weatherlocationname="New York, NY" url="http://a.msn.com/54/en-US/ct40.782,-73.832?ctsrc=msn" imagerelativeurl="http://blob.weather.microsoft.com/static/weather4/en-us/" degreetype="C" provider="Foreca" attribution="http://www.foreca.com/" attribution2="Foreca" lat="40.782" long="-73.832" timezone="-5" alert="" entityid="10109777" encodedlocationname="New+York%2C+NY"><current temperature="4" skycode="29" skytext="Partly Cloudy" date="2016-02-07" observationtime="18:00:00" observationpoint="New York, NY" feelslike="2" humidity="62" winddisplay="9 km/h East" day="Sunday" shortday="Sun" windspeed="9 km/h" /><forecast low="-3" high="5" skycodeday="31" skytextday="Clear" date="2016-02-06" day="Saturday" shortday="Sat" precip="" /><forecast low="1" high="7" skycodeday="28" skytextday="Mostly Cloudy" date="2016-02-07" day="Sunday" shortday="Sun" precip="10" /><forecast low="-3" high="3" skycodeday="16" skytextday="Snow" date="2016-02-08" day="Monday" shortday="Mon" precip="90" /><forecast low="0" high="1" skycodeday="30" skytextday="Partly Sunny" date="2016-02-09" day="Tuesday" shortday="Tue" precip="90" /><forecast low="-2" high="5" skycodeday="28" skytextday="Mostly Cloudy" date="2016-02-10" day="Wednesday" shortday="Wed" precip="50" /><toolbar timewindow="60" minversion="1.0.1965.0" /></weather><weather weatherlocationcode="wc:USNY0996" weatherlocationname="New York, NY" url="http://a.msn.com/54/en-US/ct40.714,-74.006?ctsrc=msn" imagerelativeurl="http://blob.weather.microsoft.com/static/weather4/en-us/" degreetype="C" provider="Foreca" attribution="http://www.foreca.com/" attribution2="Foreca" lat="40.714" long="-74.006" timezone="-5" alert="" entityid="23164" encodedlocationname="New+York%2C+NY"><current temperature="5" skycode="29" skytext="Partly Cloudy" date="2016-02-07" observationtime="18:00:00" observationpoint="New York, NY" feelslike="4" humidity="58" winddisplay="7 km/h East" day="Sunday" shortday="Sun" windspeed="7 km/h" /><forecast low="-7" high="4" skycodeday="31" skytextday="Clear" date="2016-02-06" day="Saturday" shortday="Sat" precip="" /><forecast low="1" high="7" skycodeday="28" skytextday="Mostly Cloudy" date="2016-02-07" day="Sunday" shortday="Sun" precip="10" /><forecast low="-2" high="3" skycodeday="16" skytextday="Snow" date="2016-02-08" day="Monday" shortday="Mon" precip="80" /><forecast low="-1" high="1" skycodeday="30" skytextday="Partly Sunny" date="2016-02-09" day="Tuesday" shortday="Tue" precip="80" /><forecast low="-3" high="5" skycodeday="30" skytextday="Partly Sunny" date="2016-02-10" day="Wednesday" shortday="Wed" precip="50" /><toolbar timewindow="60" minversion="1.0.1965.0" /></weather></weatherdata> 
1

: 「http://weather.service.msn.com/data.aspx?weasearchstr=ny,NY&culture=en-US&weadegreetype=C&src=msn

そして、それは要求された正確に何を返すんでしたがマイクロソフト気象データはまだを通じて来ている:Washington state weather data(リンクはOPのポストに示すものとは異なっている - 今、廃止されます)。

リンクで「wealocations」パラメータは、すべての気象収集ポイントのために異なっています。例えば「USWA0367」はワシントン州レドモンドのためのものである。あなたは天候の場所のコードが良いのデッドGoogleの天気予報APIですか、それが一時的にダウンだけでhere.