Author Topic: Error with Twitter Applescript  (Read 11223 times)

monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Error with Twitter Applescript
« on: January 28, 2014, 03:02:08 AM »
Hi All,


I am trying to use the twitter upload script but no matter what I try I just get an error when I attempt to launch the Applescript.  The error that is logged is not particularly helpful but maybe one of you will recognize what is going on.  The error is:



1/27/14 9:50:06.487 PM WC Twitter Uploader[1141]: WeatherCat encountered the following error in posting Twitter data: ' '.


I will point out that I never get prompted to setup the Twitter account so I am suspicious of the "J A Computing libraries" being part of the issue.  I have also confirmed my WC Twitter Uploader prefs.scpt looks correct too.

Any assistance would be greatly appreciated.

Jay

p.s.  As a side note, once this is resolved, I ultimately would like to use the WC Day Summary Twitter script but not do the posts as specified in the WC Twitter Upload script.  Are there any switches/parameters to make this change or does this involve some changes to the AppleScript?



elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
I've seen that "helpful" error (Re: Error with Twitter Applescript)
« Reply #1 on: January 28, 2014, 08:21:04 PM »
Hi Jay and WeatherCat AppleScript fans,

I am trying to use the twitter upload script but no matter what I try I just get an error when I attempt to launch the Applescript.  The error that is logged is not particularly helpful but maybe one of you will recognize what is going on.  The error is:



1/27/14 9:50:06.487 PM WC Twitter Uploader[1141]: WeatherCat encountered the following error in posting Twitter data: ' '.


I will point out that I never get prompted to setup the Twitter account so I am suspicious of the "J A Computing libraries" being part of the issue.  I have also confirmed my WC Twitter Uploader prefs.scpt looks correct too.

Yup, I've seen those errors too.  Sometimes it is just the Twitter servers that are not working.  I assume that you've tried this repeatedly?

If the problem persists, try replacing the J.A. Computing libraries.  I seem to have forgotten to include them with the latest distribution.  They are attached to this posting so you can grab them here.  Instructions on how to replace the libraries in included in the - you guessed it - WC Twitter Uploader documentation.

p.s.  As a side note, once this is resolved, I ultimately would like to use the WC Day Summary Twitter script but not do the posts as specified in the WC Twitter Upload script.  Are there any switches/parameters to make this change or does this involve some changes to the AppleScript?

Not a problem.  Once more, if you cruise thought the documentation it explains how to modify the text that is posted.  Check out the WC Webtext Uploader docs for an explanation.  Basically what you need to do is modify the WeatherCat web template to say what you want.  You don't need to modify the AppleScript beyond perhaps changing which file is uploaded to Twitter.  Again details in the docs.


Hope this helps.  Let me know if it doesn't!

Cheers, Edouard  [cheers1]


monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Re: Error with Twitter Applescript
« Reply #2 on: January 29, 2014, 03:24:03 AM »
Hi Edouard,


Unfortunately no joy.


I tried both replacing those libraries and creating a brand new directory installation from the December 2013 download and still getting the same error.  I have been trying to get past this error for days now and cannot figure out what is going on.  My other AppleScripts are working fine.  I not sure the scripts are even getting to the point to invoke the J A Computing libraries or if they are the are choking immediately upon hitting these libraries.  Could Mavericks be a factor?  Even the logs in Console are pretty useless:



1/28/14 10:06:58.499 PM WC Twitter Uploader[32575]: WC Twitter Uploader (0.9.5) has started.
1/28/14 10:07:02.291 PM WC Twitter Uploader[32578]: Twit string is: CecilWeather conditions at 22:07 EST: Temp: 13 F, Humidity: 45%,  Pressure: 30.32 in-HG, Wind gust: 1.0 mph from the SW, Daily rainfall: 0.0 in
1/28/14 10:07:04.129 PM WC Twitter Uploader[32588]: WeatherCat encountered the following error in posting Twitter data: ' '.


I have no idea what to try next.  Looking for some inspiration!


Jay



Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • 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: Error with Twitter Applescript
« Reply #3 on: January 29, 2014, 05:21:38 PM »
Twit string is: CecilWeather conditions at 22:07 EST: Temp: 13 F, Humidity: 45%,  Pressure: 30.32 in-HG, Wind gust: 1.0 mph from the SW, Daily rainfall: 0.0 in

Jay,

Try editing your Twitter string. It yields a 143 character post. Usually this just doesn't go anywhere, but maybe it is now showing up as an error.

FWIW, I have all of Edouard's scripts running on Mavericks just fine.

Steve
Steve - Avon, Ohio, USA


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

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
D'oh, why didn't I do this sooner! (Re: Error with Twitter Applescript)
« Reply #4 on: January 29, 2014, 10:56:03 PM »
Hi Jay, Steve, and WeatherCat fans,

There is a little AppleScript tool included to allow you to see the string that your current conditions are generating.  I never had it check the length because I have nice tool for getting statistics on strings.  However, D'oh!!!   Not everybody has that tool!

It is very easy to get AppleScript to compute the length and check if it is over 140 characters.  I just updated the script to do that.  It is attached to this posting.

Give that a try Jay.  That should be mor'bett'r!  ;D

Cheers, Edouard  [cheers1]

P.S. Yeah, I'll eventually get around to making another release of the AppleScripts


monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Re: Error with Twitter Applescript
« Reply #5 on: January 30, 2014, 03:18:34 AM »
Hi Steve and Edouard,


Thanks for the utility and in fact I already have been using it.  I had checked the count during some of my testing but I guess one of my reinstalls the defaults came back and the number creeped above 140.  In any case did some quick changes to get down to 130 and still I get that same error.  UGH!


I am not sure if there are many options to debug the AppleScript to step though section by section to track where things go astray.  Any suggestions?


Jay



monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Re: Error with Twitter Applescript
« Reply #6 on: January 30, 2014, 08:00:26 PM »

Hi All,

Did some more troubleshooting at lunch and have to wonder if Twitter recent change to require HTTPS access is part of the issue (https://dev.twitter.com/discussions/24239).  I have no idea how the ASTwitterLibrary.scpt are making the call.  I did confirm the problem is occurring with the following line in the AppleScript:

TwitterLib's postTweet(twitterName, twitString)

I even changed the parameters to have a 10 character "twitstring" and still nothing.  I did also download a new copy of the TwitterLibrary scripts from http://www.jacomputing.net/ just in case and no change. 

So unless there is some strange issue with Mavericks, I am starting to think the problem is with ASTwitterLibrary.scpt  and how it creates new user accounts.  Ideas/suggestions?

Thanks as always,

Jay



elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Hi Jay and WeatherCat Twitter fans,

So unless there is some strange issue with Mavericks, I am starting to think the problem is with ASTwitterLibrary.scpt  and how it creates new user accounts.  Ideas/suggestions?

Oops, you may be on to something.  What do you mean "creates new user accounts?"   I'm assume you have registered with Twitter and have a user name and password correct?  Are you referring to the process by which ASTwitterLibrary gets authorized to access your account?

Unfortunately, ASTwitterLibrary remains only partially functional. Jesse of JA Computing was struggling with the changes in the Twitter API and only has about 1/2 of the ASTwitterLibrary working.  However, I wasn't aware if the protocol to authorize ASTwitterLibrary was among the broken bits of API.

I don't know if we have had anybody try to start up a Twitter service since the API upgrade - has anybody done this?

I am a bit puzzled about this, but unfortunately, my AppleScript just hands off the string to ASTwitterLibrary to get the upload to Twitter.  So if indeed there is a problem in the authorization protocol, I'll have to get in touch with Jesse and see where he is at in getting ASTwitterLibrary to work.

Sorry, sending data to Twitter has always been a challenge. . . . . .

Cheers, Edouard

monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2


 What do you mean "creates new user accounts?"   I'm assume you have registered with Twitter and have a user name and password correct?  Are you referring to the process by which ASTwitterLibrary gets authorized to access your account?


Sorry for the confusion... I do have a Twitter account and I am referring to the authorization.


Hope that helps!


Jay



elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Sent an email to Jesse (Re: Error with Twitter Applescript)
« Reply #9 on: January 31, 2014, 09:25:00 PM »
Hi Jay and WeatherCat AppleScript fans,

Okay, I'm stumped, so I just sent an email to Jesse at J.A. Computing.  We'll just have to see what he has to say.  Unfortunately, he can be slow in answering emails so I'm afraid this is a case where . . . . .    . . . . .  will be necessary!

Cheers, Edouard  [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Hopefully a fix soon. (Re: Error with Twitter Applescript)
« Reply #10 on: February 04, 2014, 10:30:03 PM »
Dear Jay and WeatherCat fans,

I got a reply from Jesse:

Quote
The version you have probably doesn't have the fixes to allow new accounts to be authenticated.  I have some newer patched versions that have that and a bit of other functionality restored.  Still a few API calls giving me trouble.

So hopefully, the wait won't be too much longer.

Cheers, Edouard  [cheers1]

monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Re: Error with Twitter Applescript
« Reply #11 on: February 05, 2014, 02:44:18 AM »
Thanks Edouard for the continued follow-up!  At least it looks now that there was nothing wrong with the Applescripts you provided and the way I installed them.


Jay



monymony

  • Strong Breeze
  • ***
  • Posts: 173
  • CoCoRaHS - MD-CC-16
    • EW3643
    • KMDELKTO10
    • Cecil County Maryland Weather
  • Station Details: Davis Vantage Pro 2
Re: Hopefully a fix soon. (Re: Error with Twitter Applescript)
« Reply #12 on: February 26, 2014, 10:40:16 PM »
So hopefully, the wait won't be too much longer.


 [rainyluck]



elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Sorry, just gave Jesse a nudge. (Re: Error with Twitter Applescript)
« Reply #13 on: February 27, 2014, 11:04:04 PM »
Hi Jay and WeatherCat Twitter fans,

Sorry, I had noticed that Jesse was a little slow in getting back to me, but I've been bogged down with some of d'em "sekret" agent stuff . . .

So hopefully, the wait won't be too much longer.


 [rainyluck]

I just sent another email to Jesse.  I'll let you know what he says.

Cheers, Edouard  [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Still an error . . (Re: Error with Twitter Applescript)
« Reply #14 on: March 01, 2014, 12:51:07 AM »
Hi Jay and WeatherCat Twitter fans,

I got a reply from Jesse, but alas it didn't turn out as Jesse hoped.  He sent me some revised versions of the libraries.  I installed them in my working copy of the WC Twitter Uploader and it stopped working all together.  I had to roll-back to the older versions of the libraries to get myself back in business.  I reported the result to Jesse and he hasn't gotten back to me yet.

So alas, it appears there are still "issuez" in making this work.  All I can say is . . .

Stay tuned . . .

Cheers, Edouard  [cheers1]