Update icon for Baidu Weather workflow

Source: Internet
Author: User
Tags blizzard

Alfred Workflow: Baidu Weather, Modified update icon display:

Download: Https://github.com/BobSte/weather-workflow

The original code is a PHP script that adds a function to the image and some pictures. Added to weather.php

functionGetweathericon ($weather) {    if($weather= = ' Icon ') {        return' Cloudy2.png '; } ElseIf($weather= = ' Unknown ') {        return' Unknown.png '; }    $map=Array(' sunny ' = ' sunny.png ', ' sunny see cloudy ' = ' cloudy1.png ', ' sunny turn cloudy ' = ' cloudy3.png ',                 ' Cloudy to clear ' = ' cloudy4.png ', ' yin turns fine ' = ' cloudy4.png ', ' cloudy ' = ' cloudy5.png ', ' Yin ' = ' overcast.png ', ' rain ' = ' light_rain.png ', ' showers ' and ' shower1.pn ' G ', ' drizzle ' = ' shower1.png ', ' rain ' = ' shower2.png ', ' Heavy rains ' and ' shower ' 3.png ', ' rainstorm ' = ' shower3.png ', ' thunderstorm ' = ' tstorm1.png ', ' thunderstorm to moderate ' =&gt ;                 ' Tstorm2.png ', ' Thunderstorm turns heavy rain ' and ' tstorm3.png ', ' thunderstorm to rainstorm ' = ' tstorm3.png ', ' Sleet ' = ' sleet.png ', ' hail ' = ' hail.png ', ' snow ' = ' snow1.png ', ' Snow ' = ' snow1.png ', ' snow ' = ' snow2.png ', ' snow ' = ' snow3.png ', ' blizzard  ' = ' and ' Snow4.png ',               ' Big blizzard ' = ' snow5.png ', ' fog ' = ' mist.png ', ' fog ' and ' fog.png ', ' Haze ' = ' haze.png ', ' haze ' = ' haze.png ',                 ); foreach($map  as $key=$value) {        if($weather==$key) {            return $value; }    }    foreach(Array_reverse($map) as $key=$value) {        if(strstr($weather,$key)) {            return $value; }    }    return' Unknown.png ';}

Update icon for Baidu Weather workflow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.