Author Topic: WeatherCat Scripts of 2013-12-01  (Read 89353 times)

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
WeatherCat Scripts of 2013-12-01
« on: December 01, 2013, 10:32:42 PM »
Dear WeatherCat AppleScript fans,

NOTICE: The current version of ASTwitterLibrary used in WC Twitter Uploader is not working correctly and cannot authenticate new installations of the script.  Unfortunately the problem can only be solved by the author of ASTwitterLibrary and thus far, he has not been successful.  So until further notice, WC Twitter Uploader is only useable for for existing users.  For more information on the problem, see this thread on the WeatherCat forum:

http://athena.trixology.com/index.php?topic=1157.0


I have completed my latest update to my collection of AppleScripts for WeatherCat.  You can download the latest and greatest here:

http://www.canebas.org/WeatherCat/AppleScripts/WeatherCat%20Scripts%202013-12-01.zip

This release mainly provides expanded support for uploading text to Twitter and is a much more extensive modification than anything done in quite a while.  So upgrading is more messy.  Your old preference files for the following scripts WC Temperature Falling, WC Temperature Rising, WC Twitter Uploader, and WC Zambretti Forecaster will need to be modified because there are new configuration variables associated with the upgrade.

In addition, there are three new AppleScripts: WC Webtext Twitter which is template, and two examples of that template: WC Day Summary Twitter and WC Forecast Twitter.  These are basically little stubs that use new routines in the WC Script tools.scpt to pass strings from any AppleScript to WC Twitter Uploader.  In addition to periodically reporting current conditions, WC Twitter Uploader will collect all strings passed to it, and upload them to Twitter once a minute. 

WC Webtext Twitter has a very interesting feature of allowing to you create a WeatherCat web template containing any text that you can generate with WeatherCat tags and have them uploaded to Twitter.  The WC Forecast Twitter uploads the Davis (or others) forecast to Twitter.  WC Day Summary Twitter  generates a summary of the days weather and uploads that to Twitter.  The WeatherCat web templates do to that are also included in the new distribution along with two utility droplets: UNIX Path to Clipboard and HFS Path to ClipboardUNIX Path to Clipboard allows you to drag and drop a file onto it and it will paste the complete UNIX path of that file.  The analogous script: HFS Path to Clipboard does the same for the HFS (OS-9) file path format.  There is documentation for all these changes.  If you want to make your own custom scripts based on WC Webtext Twitter definitely go through the documentation on that before proceeding.

In case you haven't surmised this by now, this is a complex and potentially tricky upgrade.  If you have no interest in Twitter beyond what's already supported, don't bother upgrading.  If you decide to take this one - take care!  It it likely to be troublesome!

Cheers, Edouard  [cheers1]

P.S. Here the full release notes:

Quote
December  1, 2013:
  • Changed preference variable updateTime in WC Twitter Uploader from specifying the number of seconds between current weather conditions updates to the number of minutes between such updates.
  • Added a handler to  WC Twitter Uploader allowing it to process strings from any other AppleScript as Twitter uploads.  The strings are queued up and then processed once a minute by  WC Twitter Uploader.
  • Added two additional handlers to the WC Script tools library to simply uploading arbitrary strings to Twitter.  The forwardTwitterString handler can be used to send strings for upload.  The forwardFileTextToTwitter handler opens up a text file and extracts the string for uploading.  This is intended for uploading WeatherCat templates after processing.
  • Added support to WC Zambretti Forecaster to optionally upload forecasts to Twitter.  This is controlled by the preference variable: useTwitter.
  • Added support to WC Temperature Falling and WC Temperature Rising to optionally upload forecasts to Twitter.  This is controlled by the preference variable: useTwitter.  In addition added an additional preference variable: stationName, which can be used to assign a name to the report of a temperature exceeding a threshold.
  • Created a prototype AppleScript: WC Webtext Twitter intended for modification into various user-created tools to upload WeatherCat templates to Twitter.  This AppleScript is intended to be refashioned as the two examples: WC Day Summary Twitter and WC Forecast Twitter have been.
  • Created two examples of out to upload WeatherCat web template text to Twitter.  WC Forecast Twitter uses the Forecast text twit.txt WeatherCat web template to upload the forecast generated by the Davis Vantage Pro-2 station.  WC Day Summary Twitter uses the Daily summary text twit.txt WeatherCat web template to upload a summary of the preceding days conditions to Twitter.
  • Created two utility AppleScripts to assist in creating customized versions of the WC Webtext Twitter AppleScript and related chores.  UNIX Path to Clipboard allows you to drag and drop a file onto it and it will paste the complete UNIX path of that file.  The analogous script: HFS Path to Clipboard does the same for the old HFS (OS-9) file format used by other AppleScripts like WC ET Reporter.

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #1 on: December 02, 2013, 10:53:08 PM »
Edouard and AppleScript experimenters,

As Edouard noted, I'd been testing the latest iteration of the Twitter script early last week and all was working fine. Then I went away for four days and found that things were not working so fine after all...

I'm only getting one Twitter post after I launch the Twitter Uploader script, and then nothing. I haven't had time to take out my modifications to see if something I've done caused toe problem, but I'll get to that soon.

I just thought I'd update with my results before too many folks swapped for the new version. Edouard has been running them fine on Snow Leopard for weeks, and I'm on Mavericks, so that might be some of the problem.

Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Check for libraries (Re: WeatherCat Scripts of 2013-12-01)
« Reply #2 on: December 03, 2013, 09:24:25 PM »
Hi Steve and WeatherCat Scripters,

I'm only getting one Twitter post after I launch the Twitter Uploader script, and then nothing. I haven't had time to take out my modifications to see if something I've done caused toe problem, but I'll get to that soon.

If you have been doing a little hackin' of your own, one possibility is that the J.C. Computing library files were deleted through some sort of mysterious process that I don't understand myself, but appears to be defense against people trying to modify other people's code.  You need to have these two files: ASObject.scpt and ASTwitterLibrary.scpt in the Scripts folder of the resource bundle that comes with the WC Twitter Uploader application.  If they are missing you could just grab the files from the distribution and put them back using the instructions that you'll find in the WC Twitter Uploader documentation (complete with helpful screenshots.)

Sorry, I wish there was a way to avoid this, but I sure don't know of it!

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #3 on: December 04, 2013, 02:56:42 PM »
Edouard,

That happened to be the first thing I checked. I remembered that problem from when you were first developing the scripts. Last evening I went into Time Machine and replaced my entire WeatherCat Scripts folder with the one from November 25, and I'm back to working OK for the every two hour posts. I'll start swapping in bits from a new download of the December 1 package and see if it continues working OK.

Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Hmm, puzzling. (Re: WeatherCat Scripts of 2013-12-01)
« Reply #4 on: December 04, 2013, 09:49:52 PM »
Hi Steve and WeatherCat AppleScript fans,

Hmm, I'm not sure why things would be any different for the December 1 distribution over what I sent you back in November.  I've "improved" my packaging scheme so that I use the "live" files running on my computer.  I just copy the AppleScripts and then replace my preferences with the default set.  So WC Twitter Uploader should be the same AppleScript I sent you earlier.  Please do keep me posted.  If anybody else has problems also let me know!

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #5 on: December 05, 2013, 01:31:52 AM »
Edouard,

I changed back to the day before you sent the new Twitter test files to me. So I'm currently using what I've been using since installing Mavericks and making the free RAM change.

Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
WC Twitter Uploader hung on me. (Re: WeatherCat Scripts of 2013-12-01)
« Reply #6 on: December 05, 2013, 07:51:12 PM »
Dear Steve and WeatherCat fans,

While trying to hunt down some "sekret agent stuff," I managed to get WC Twitter Uploader to hang while starting up, requiring a force-quit.  Restarting it got everything working again.  I'm not sure why and it has never happened to me before.  However, I'll keep an eye on it.  If anybody else sees something - let me know!

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #7 on: December 08, 2013, 04:14:11 PM »
I MAY have found the problem I was having. I reinstalled all the new stuff, launched it, and the scripts that I have parked in my Dock launched...except Twitter uploader. It seems it was launching a copy out of the ~/Library/Mail Downloads folder. I've emptied that folder and restarted WeatherCat and all scripts. Now we'll see if it does what it is supposed to does. :)

Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
That would explain it!! (Re: WeatherCat Scripts)
« Reply #8 on: December 08, 2013, 09:55:17 PM »
Howdy Steve and WeatherCat scripters,

I MAY have found the problem I was having. I reinstalled all the new stuff, launched it, and the scripts that I have parked in my Dock launched...except Twitter uploader. It seems it was launching a copy out of the ~/Library/Mail Downloads folder. I've emptied that folder and restarted WeatherCat and all scripts. Now we'll see if it does what it is supposed to does. :)

Uh yeah, if you aren't using the latest version of the script - it can't possibly work!!

You may still have problems, but at least you are on the right track!!  [tup]

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1554
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #9 on: December 10, 2013, 03:32:47 PM »
Everything is working fine now on my system. User error...  ::)
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Hurray! (Re: WeatherCat Scripts of 2013-12-01)
« Reply #10 on: December 10, 2013, 08:04:38 PM »
Howdy Steve and WeatherCat scripters,

Everything is working fine now on my system. User error...  ::)

Hurray!  Glad it was nothing more complicated than that!  [tup]

And as to user error . . . . . . been there, done that and . . . . .

Cheers, Edouard  [cheers1]

meteoperugia

  • Gentle Breeze
  • **
  • Posts: 79
    • DW0950
    • IPERUG54
    • MeteoPerugia
  • Station Details: Davis Vantage Pro2, iMac (Retina 5K, 27-inch, Late 2015), WeatherCat 3
Re: WeatherCat Scripts of 2013-12-01
« Reply #11 on: September 01, 2014, 01:31:11 PM »
Hi Edouard,
assistance was forced to format my HD in order to fix logic unit of old iMac. They installed a downgrade OS from Lion to Snow Leopard so I'm not able to restore files from both Time Machine and CCC backups.
I'm restoring manualy all SW, drivers, pref etc and Weather Cat (thanks Stu) is running again without pref and data lost.

There is a problem with Twitter Upload Script. It's running but result is the known "" window. If I open main.script and push RUN the message resulting is:

error "The document file Macintosh HD:WeatherCat Scripts 2013-12-01:WC Twitter Uploader.app:Contents:Resources:Scripts:WeatherCat Script Library:WeatherCat Script Prefs:WC Twitter Uploader prefs.scpt is not found." number -43 from file "Macintosh HD:WeatherCat Scripts 2013-12-01:WC Twitter Uploader.app:Contents:Resources:Scripts:WeatherCat Script Library:WeatherCat Script Prefs:WC Twitter Uploader prefs.scpt" to file


I guess there is a missing path somewehere and/or loosing keychain data of previous OS Lion, script can't access to Twitter. I though to receive first run window to authenticate script with Twitter but even if I've downloaded your last folder and installed in my MacIntoshHD root, the script start but give me every time "" message.
If i run the Test Script the result is a correct string with less than 140 digit.

Any idea about it?

Many thanks in advance and best regards.
Federico
Federico
Perugia, Italy


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Could be the dreaded library problem. (Re: WeatherCat Scripts of 2013-12-01)
« Reply #12 on: September 01, 2014, 09:54:47 PM »
Hi Federico and WeatherCat scripters,

There is a problem with Twitter Upload Script. It's running but result is the known "" window. If I open main.script and push RUN the message resulting is:

error "The document file Macintosh HD:WeatherCat Scripts 2013-12-01:WC Twitter Uploader.app:Contents:Resources:Scripts:WeatherCat Script Library:WeatherCat Script Prefs:WC Twitter Uploader prefs.scpt is not found." number -43 from file "Macintosh HD:WeatherCat Scripts 2013-12-01:WC Twitter Uploader.app:Contents:Resources:Scripts:WeatherCat Script Library:WeatherCat Script Prefs:WC Twitter Uploader prefs.scpt" to file

That error is attempting to access the preference file for WC Twitter Uploader.  The file is called WC Twitter Uploader prefs.scpt and it should be with all the other preference files in the folder:

~/elagache/Applications/WeatherCat Scripts/WeatherCat Script Library/WeatherCat Script Prefs

If you see it there, then the problem isn't with the script but with your attempt to run it within the AppleScript editor.

I though to receive first run window to authenticate script with Twitter but even if I've downloaded your last folder and installed in my MacIntoshHD root, the script start but give me every time "" message.

However, there is another unfortunate potential problem.  The current version of the ASTwitterLibrary isn't able to authenticate new users.  There is a sad thread on the matter here:

http://athena.trixology.com/index.php?topic=1157.0

I have repeatedly bugged the developer of the ASTwitterLibrary and now he doesn't answer my emails anymore.  So at the very least, we are in for a long wait to get this bug fixed.  Probably the best thing you could do is to try to salvage your keychain if possible.  That should allow you to upload to Twitter once more. 

Since you were prompted to authenticate that seems to be working better than anyone else who has had this problem.  You might try replacing the libraries to make sure nothing got corrupted.  You can get as current a copy as exists attached to this posting:

http://athena.trixology.com/index.php?topic=1157.msg9655#msg9655

Instructions on how to replace the libraries are included in the documentation for WC Twitter Uploader.

Alas we are really out of luck until this library gets fixed.

Sorry, such are the conditions that prevail.  [rainyluck]

Edouard


jhoke

  • Gentle Breeze
  • **
  • Posts: 56
  • this space for rent
    • EW5604
    • KPAALBRI11
    • Indian Mountain Lakes - Carbon County Weather
  • Station Details: Davis Vantage Pro2, MacMini (i5 2.5Ghz 4GBRam 500GB HD, 4TB attached storage), other bits coming soon (UV, etc)
Re: WeatherCat Scripts of 2013-12-01
« Reply #13 on: September 01, 2014, 10:50:38 PM »
Edouard - are there other AppleScript twitter libraries that could be utilized, or is the applescript tightly coupled to the current ones?

I wonder if there is a way to do this through other means ... bash script called from an applescript, etc...

meteoperugia

  • Gentle Breeze
  • **
  • Posts: 79
    • DW0950
    • IPERUG54
    • MeteoPerugia
  • Station Details: Davis Vantage Pro2, iMac (Retina 5K, 27-inch, Late 2015), WeatherCat 3
Re: Could be the dreaded library problem. (Re: WeatherCat Scripts of 2013-12-01)
« Reply #14 on: September 02, 2014, 03:07:31 PM »

That error is attempting to access the preference file for WC Twitter Uploader.  The file is called WC Twitter Uploader prefs.scpt and it should be with all the other preference files in the folder:

~/elagache/Applications/WeatherCat Scripts/WeatherCat Script Library/WeatherCat Script Prefs

If you see it there, then the problem isn't with the script but with your attempt to run it within the AppleScript editor.

The file is present but with a different path and folder name:

MacintoshHD/WeatherCat Scripts 2013-12-01/WeatherCat Script Library/WeatherCat Script Prefs

I've tried to move and rename folders but no way to send posts to Twitter. If I open and run the file WC Twit String Test.scpt I receive a correct text string with all weather data.

Quote
However, there is another unfortunate potential problem.  The current version of the ASTwitterLibrary isn't able to authenticate new users.  There is a sad thread on the matter here:

http://athena.trixology.com/index.php?topic=1157.0

I have repeatedly bugged the developer of the ASTwitterLibrary and now he doesn't answer my emails anymore.  So at the very least, we are in for a long wait to get this bug fixed.  Probably the best thing you could do is to try to salvage your keychain if possible.  That should allow you to upload to Twitter once more. 

Since you were prompted to authenticate that seems to be working better than anyone else who has had this problem.  You might try replacing the libraries to make sure nothing got corrupted.  You can get as current a copy as exists attached to this posting:

http://athena.trixology.com/index.php?topic=1157.msg9655#msg9655

Instructions on how to replace the libraries are included in the documentation for WC Twitter Uploader.

READ and DONE before write this post. No results. Just the same error message:
WeatherCat encountered the following error in posting Twitter data: ' '.

OK. I give up. I'll check betimes in that section if there are some news about it. In the meantime no more hourly posts with weather data and forecast for all my Twitter and Facebook funs.....  :'(

Thanks for you kind and fast reply. All the best Edouard!  [cheers1]

Federico.
Federico
Perugia, Italy