Author Topic: TweeTWX Help  (Read 377 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
TweeTWX Help
« on: April 17, 2019, 03:32:13 PM »
I got TweetWX from Ken working but my tweets have some odd data...

NWS fcst: ThisAfternoonChc Shwrs And T-Storms : , Hi 79°F ↓; TonightShwrs And T-Storms : , Lo 66°F ↑; ThuShwrs And T-Storms : , Hi 79°F ↓;  #weather

Notice the &uarr and the &darr

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: TweeTWX Help
« Reply #1 on: April 17, 2019, 03:51:40 PM »
Yep.. that's deliberate and from the NWS.  The ↓ is a down-arrow character, the ↑ is a up-arrow -- both indicate changes in temperature beyond what is 'normal' for the period.

Both are done as HTML entities and not raw UTF-8 characters (which are needed for Twitter) since the data that appears in your normal forecast (index and wxforecast pages) are both ISO-8859-1 character sets, and a UTF-8 character for those arrows would result in a 'blob' character display on your website.

You can change TweetWX-forecast.php from
Code: [Select]
$utfmessage = iconv('ISO-8859-1','UTF-8//TRANSLIT',$message);
to
Code: [Select]
$utfmessage = iconv('ISO-8859-1','UTF-8//TRANSLIT',$message);
$utfmessage = html_entity_decode($utfmessage,ENT_NOQUOTES,'UTF-8');
and that should make Twitter happy.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: TweeTWX Help
« Reply #2 on: April 17, 2019, 03:58:07 PM »
Thanks Ken!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb