Trixology

WeatherCat => WeatherCat Integration => Topic started by: meteoperugia on November 08, 2013, 10:50:58 AM

Title: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 08, 2013, 10:50:58 AM
Hi everybody.
There was a script uploaded by a american member (Rick, GoldenGoose) that with Cronnix allowed to upload WeatherCat data (daily, weekly, monthly data, webcam images, statistics…etc) to Twitter. Now Twitter API version is uploaded to from 1 to 1.1 and it doesn't run since last june.
I've tried to update API, Python, Tweepy….but NO WAY ti upload data in that way.
I know there is another script (Thanks Eduard!) but with last method I was able to custom different scripts at different time to upload different data to Twitter. I need it because Twitter repeat messages to my FaceBook weather page.
I will be glad if somebody could explain me how to run that script again.
Script was called twitter_API.php and was following:

Quote
<meta name="robots" content="noindex,nofollow">
   
#!/usr/bin/php
<?php
// For Account:   'Twitter Account Name Goes Here'

// Make sure these files are in a directory called "lib"
require "/your LWC uploads folder name/lib/EpiCurl.php";
require "/your LWC uploads folder name/lib/EpiOAuth.php";
require "/your LWC uploads folder name/lib/EpiTwitter.php";

// Settings required for each account/user
define(CONSUMER_KEY,"Your Key Code goes here between quotes");
define(CONSUMER_SECRET,"Your Secret");
define(USER_TOKEN,"Your Token");
define(USER_SECRET,"Your User Secret");

//Text to be updated on twitter
$status = "Temp: STAT$TEMPERATURE:CURRENT$ F * HeatIndex: STAT$HEATINDEX:CURRENT$ F * Hum: STAT$EXTHUMIDITY:CURRENT$% * Dew: STAT$DEWPOINT:CURRENT$ F * Baro: STAT$PRESSURE:CURRENT$ PRESSUREUNITS$ * UV: STAT$UV:CURRENT$ * Rain: STAT$RAIN:TOTAL:TODAY$ RAINUNITS$ @ t12$ ";

// Format text as utf8 and chomp at 140 chars
$text = utf8_encode(substr($status,0,140));

$twitterObj = new EpiTwitter(CONSUMER_KEY,CONSUMER_SECRET,USER_TOKEN,USER_SECRET);
$x = $twitterObj->post_statusesUpdate(array('status' => $status));

// Test whether the tweet was posted successfully.
if ($x->id) {
   echo "Tweet Posted: ".$x->id."\n";
} else {
   echo "Error Posting Tweet\n";   
}   

?>

Thanks in advance!  ;)

ANOTHER QUESTION (to Stu)

I send WeatherCat email alerts to a FaceBook (again) upload address but Facebook shows only the email header (object) but not the text where are advices and data. There is a way to add data do the object?
Ex: Now WC send a message where in the title is "HEAVY RAIN ALARM" and in the text are data to see HOW HEAVY the rain is (rain rate 100mm/h). Facebook receive email but show only "HEAVY RAIN ALARM". I would add to the title rain rate (or other weather data) in order to se on Facebook the message "HEAVY RAIN ALARM: rain rate is 100mm/h at 11:49 nov 09 2013".
Some idea about it?

Thanks again everybody!!! [tup]

Federico
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: WCDev on November 08, 2013, 05:28:49 PM
Hi Federico,
Maybe there's some setting on Facebook that filters the body of the email out?
Title: Might be easier to use AppleScript (Re: Problems with Scripts to Twitter)
Post by: elagache on November 08, 2013, 10:53:40 PM
Hi Federico and WeatherCat fans,

There was a script uploaded by a american member (Rick, GoldenGoose) that with Cronnix allowed to upload WeatherCat data (daily, weekly, monthly data, webcam images, statistics…etc) to Twitter. Now Twitter API version is uploaded to from 1 to 1.1 and it doesn't run since last june.
I've tried to update API, Python, Tweepy….but NO WAY ti upload data in that way.
I know there is another script (Thanks Eduard!) but with last method I was able to custom different scripts at different time to upload different data to Twitter.

I think you are going to have a very hard time trying to coax those old scripts to work again with Twitter.  The only reason my AppleScript is still working is because of the nice fellow at J. A. Computing who created a patched version of his own AppleScript libraries.  As far as I know, he - still - hasn't gotten all of this library's routines to work properly since the Twitter API upgrade.

Have you looked at my AppleScript at all?  If you had a version that just made a Twitter upload and quit would that work for you?  I'm up to neck in shakedown "issuez" related to (guess what) . . .  (http://www.canebas.org/Automotive/V8_Buick/Misc/Biquette_V8_Buick_signature.gif)  However, I might be able to put together a tweaked AppleScript that you could run using Cronnix.  You could have multiple versions of the same AppleScript with slilghtly different names and that might do what you want.

Cheers, Edouard  [cheers1]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 09, 2013, 04:26:25 PM
Hi Stu!
No, all settings on Facebook and twitter are fine and if I post a message @Twitter after few seconds it will be repeated @FB. The problem is about permissions for post messages @ Twitter from third party program/script because API was been upgraded from ver 1 to 1.1 and procedure of authentication is different now.

About Facebook function "post from email" if you send an email message to a definite Facebook address it will be post in your FB page BUT NOT the body text of the message but just the TITLE so all my message alert from WeatherCat to FB address are just "HEAVY RAIN ALERT" or " ICY ALERT" (etc) WITHOUT weather data that are present on the text body.
I wondering if there is possibility to add even if just 1 weather data to the email object in order to see "HEAVY RAIN ALERT. RAIN RATE IS 100mm/h at [time and date]".

Hi Eduard,
I'm already using your script (working very well!) to send to Twitter a string with a summary of weather data every hour. I wish I could create different scripts with different strings based on webtags so I can send hourly data, daily data, weekly and monthly data, weather forecast, webcam image etc ... at times and dates scheduled (by Cronnix?).
Before I had 8 different scripts that regulated by Cronnix sent data to Twitter (which then sent them to Facebook) at intervals of 1 hour, 12 hours, 24 hours, 1 week and 1 month.....
This for example is the script that sent the monthly summary on the last day of each month

Quote
#!/usr/bin/python

import sys
import tweepy

CONSUMER_KEY = 'xxxxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxxxx'
USER_TOKEN = 'xxxxxxxxxxxxxxxxxxx'
USER_SECRET = 'xxxxxxxxxxxxxxxxxxxx'

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(USER_TOKEN, USER_SECRET)
api = tweepy.API(auth)

statusUpdate = "Dati Mensili: MAX STAT$TEMPERATURE:MAX:THISMONTH$C il STAT$TEMPERATURE:MAX:THISMONTH:TIME$*MIN STAT$TEMPERATURE:MIN:THISMONTH$C il STAT$TEMPERATURE:MIN:THISMONTH:TIME$*Vento STAT$WINDSPEED:MAX:THISMONTH$ WINDSPEEDUNITS$ il STAT$WINDSPEED:MAX:THISMONTH:TIME$*Pioggia STAT$RAIN:TOTAL:THISMONTH$ RAINUNITS$"

statusdate = statusUpdate[140:]
api.update_status(statusUpdate)

Following script sent a webcam image to twitter (and Facebook later) at 7.00, 12.00 and 18.00…..

Quote
#!/usr/bin/python

import sys
import tweepy

CONSUMER_KEY = 'xxxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxx'
USER_TOKEN = 'xxxxxxxxxxxxxxxxxxx'
USER_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(USER_TOKEN, USER_SECRET)
api = tweepy.API(auth)

statusUpdate = "http://www.meteoperugia.altervista.org/webcam800.jpg"

statusdate = statusUpdate[140:]
api.update_status(statusUpdate)

AppleScript you're talking about (the tweaked on!) will be exactly what I need! ;)
Think about your (fantastic) GhostBuster car and when you'll be free let me know if there are news about scripts. There is no hurry.

Thanks everybody guys. Glad to meet you again

I offer a pint of Imperial IPA to each of you. I brew it according to BrewDog Scottish recipe and I know you'd like it ..... although those of brewdog are honestly better than mine!
That's the label  [cheers1] [beer]
(https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn2/971527_10151975234316387_2085741734_n.jpg)
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 09, 2013, 04:40:18 PM
[OT]About Brewdog IPA I'm sure Stu knows what I'm speaking about but for yankee Eduard is something like FlyingDog or DogFish beers…..but scottish
I'm brewing IPA and American Pale Ale which are my favorite beers and I am proud of my beers that are perhaps not as good as these but they are better than many others who are famous in stores. That's my last creatures……  [bounce]
[cheers1]

(https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash3/551284_10151971348001387_811567313_n.jpg)

(https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-frc3/1235961_10151867545686387_1300508552_n.jpg)

Sorry for the name of one of my beer that is a dirty word. I've removed…  ;)

[end of OT]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: WCDev on November 09, 2013, 07:55:08 PM

About Facebook function "post from email" if you send an email message to a definite Facebook address it will be post in your FB page BUT NOT the body text of the message but just the TITLE so all my message alert from WeatherCat to FB address are just "HEAVY RAIN ALERT" or " ICY ALERT" (etc) WITHOUT weather data that are present on the text body.
I wondering if there is possibility to add even if just 1 weather data to the email object in order to see "HEAVY RAIN ALERT. RAIN RATE IS 100mm/h at [time and date]".

Ah, I see - I'll add it to the feature request list, thanks!

With regards to the removed content, personally I found it very funny, but you can't post it here :)
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: wurzelmac on November 09, 2013, 08:34:09 PM
Thanks for removing - not funny for me.  :-X

Sorry for that, Federico. I will never understand, why words as used on your removed beer-label will ever be funny or cool.  :'(
No way.

Reinhard

Update: I don't know what a monkey has to do with Indians...  :-[
Title: Can't grab webtags from AppleScript (Re: Problems with Scripts to Twitter)
Post by: elagache on November 09, 2013, 10:17:38 PM
Hi Federico and WeatherCat fans,

I'm already using your script (working very well!) to send to Twitter a string with a summary of weather data every hour. I wish I could create different scripts with different strings based on webtags so I can send hourly data, daily data, weekly and monthly data, weather forecast, webcam image etc ... at times and dates scheduled (by Cronnix?).

Hmm, what you are trying to do is more complex than an AppleScript can easily handle.  There is no way for an AppleScript to request things like webcam images or the weather forecast.  How were you doing this in the past?  Were you having WeatherCat creating special "web page" from a WeatherCat web template and then uploading that to Twitter?

Unfortunately, my Twitter AppleScript couldn't be used to do this even with a modification to run only once.  It might to be too hard to create an AppleScript that would read a web page file generated by WeatherCat and uploading it to Twitter using the J.A. Computing library.  Is that something that might work for you?

Cheers, Edouard  [cheers1]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 09, 2013, 10:58:46 PM
Thanks for removing - not funny for me.  :-X

Sorry for that, Federico. I will never understand, why words as used on your removed beer-label will ever be funny or cool.  :'(
No way.

Reinhard

Update: I don't know what a monkey has to do with Indians...  :-[

Is just a beer I brew and store in my cellar and I drink with just 2-3 friends. You can listen the same word in thousand songs from the radio and hundreds movie from TV and your sons can do it too. It wouldn't be offensive (off course). It's an irreverent strong male American beer and that name it's a simple recall for anything above.
But I've removed.
Sorry again for mistake but if it's possible let's go ahead with the thread. Take it easy.  ;)

Update: the monkey is in all first beer label I've printed (as a brand). India Pale Ale is a style of British beer and not and Indian beer. It was a Pale Ale exported to India for British soldiers and because the journey with ships was very long it was brewed with more alcohol and more hops that are both natural preservative. Just last thing: India is FULL of monkeys but that's different matter.   [lol]
Title: Re: Can't grab webtags from AppleScript (Re: Problems with Scripts to Twitter)
Post by: meteoperugia on November 09, 2013, 11:07:16 PM
Hi Federico and WeatherCat fans,
Hmm, what you are trying to do is more complex than an AppleScript can easily handle.  There is no way for an AppleScript to request things like webcam images or the weather forecast.  How were you doing this in the past?  Were you having WeatherCat creating special "web page" from a WeatherCat web template and then uploading that to Twitter?

Unfortunately, my Twitter AppleScript couldn't be used to do this even with a modification to run only once.  It might to be too hard to create an AppleScript that would read a web page file generated by WeatherCat and uploading it to Twitter using the J.A. Computing library.  Is that something that might work for you?

Cheers, Edouard  [cheers1]

The script is simple as you can see. Maybe the problem is that uses WeatherCat web tags. All 8 scripts are similar and are in "source" WC folder. The specific string is different for each script and every time WC update weather conditions replaces web tags with new data and create a PHP script in "CUSTOM WEB" WC folder.
In attachment the read me file received from Rick (GoldenGoose) farmer member of this forum. I don't know so much about applescripts so I hope if you read the RTF it will be more clear what I'm talking about.
Many thanks in advance. [tup]
Title: Would need to save files and then Twit them. (Re: Webtags from AppleScript)
Post by: elagache on November 10, 2013, 09:47:45 PM
Hi Federico and WeatherCat fans,

The script is simple as you can see. Maybe the problem is that uses WeatherCat web tags. All 8 scripts are similar and are in "source" WC folder. The specific string is different for each script and every time WC update weather conditions replaces web tags with new data and create a PHP script in "CUSTOM WEB" WC folder.

Okay I see how this is supposed to work, but unfortunately, AppleScript isn't like PHP.  You can't use WeatherCat to process an AppleScript because WeatherCat won't recognize the file type.

The only way I can imagine doing this is to create a small file that has the text you want to have created.  Say in the example you post, create a WeatherCat template that just has this single line in it:

Code: [Select]
Temp: STAT$TEMPERATURE:CURRENT$ F * HeatIndex: STAT$HEATINDEX:CURRENT$ F * Hum: STAT$EXTHUMIDITY:CURRENT$% * Dew: STAT$DEWPOINT:CURRENT$ F * Baro: STAT$PRESSURE:CURRENT$ PRESSUREUNITS$ * UV: STAT$UV:CURRENT$ * Rain: STAT$RAIN:TOTAL:TODAY$ RAINUNITS$ @ t12$
This would create the line of text that you want posted to Twitter and save it as a text file.  An AppleScript could then open up this file and send the text within to Twitter.

Does that sound like something that would work for you?

Cheers, Edouard  [cheers1]
Title: Re: Might be easier to use AppleScript (Re: Problems with Scripts to Twitter)
Post by: Steve on November 10, 2013, 09:53:08 PM


Edouard and Federico,

I tried this method for doing a daily summary a year or so ago, and didn't get it to work. It was soon after you came up with the separate prefs file, so I copied the AppleScript and copied the prefs, renamed them, and changed internal pointers. I can't recall now why it didn't work. I vaguely recall that it had something to do with the o-auth or something, but I might be completely off. I might give this a go again and see.

Steve



You could have multiple versions of the same AppleScript with slilghtly different names and that might do what you want.
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 11, 2013, 11:16:15 AM
The premise that I can do without all this, the PHP scripts that I mentioned were very comfortable because they can be easily customized by changing the entry of webtags of WeatherCat and schedulized with Cronnix. I tried to send a message to Rick to find out how I could make the scripts running again but still did not reply. Some appreciated read the forecast, weather data updates, webcam images, weather summaries... on Facebook at regular intervals and when the Twitter API 1.0 has stopped working I received several messages from people in the area that used to see every morning at the FB page local weather. So I tried to update the API and Python and Tweepy to new versions but it did not work anymore.
The best thing would be to have the ability to publish directly from WeatherCat on FaceBook text strings with WebTAG updated with weather data from WeatherCat and without going through Twitter and then without the limit of 140 digits ..... but I don't know if this is possible. Maybe a way could be using the Facebook "Email_upload" function, tweaking Wheatercat in order to upload data in the title of the messages….. maybe.  :)

At the moment I'm happy to send the weather updates every hour with Edouard script that works fine….  ;)

Thanks everybody for support  [tup]
Title: It would be a new AppleScript. (Re: Problems with Scripts to Twitter)
Post by: elagache on November 11, 2013, 07:35:36 PM
Howdy Steve, Federico, and WeatherCat scripting tinkerers,

I tried this method for doing a daily summary a year or so ago, and didn't get it to work.

Actually, I was thinking about coming up with an entirely different AppleScript where the problem of preferences wouldn't come up.  All this AppleScript would do is read a file that WeatherCat had processed and upload the string to twitter verbatim.  Since it would be very short, I thought I would just have a single preference embedded in the file that would be easy to edit using the AppleScript editor.  In this scheme each additional twit would have a separate AppleScript application associated with it.  You would just edit the name of the file WeatherCat creates in each case.

I took a quick look at this stuff yesterday, but this morning I'm back to them other "issuez."  I'll try to take another look later on.  It doesn't look difficult, but I need a little free time to try it out.

Cheers, Edouard  [cheers1]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: Steve on November 12, 2013, 01:30:01 AM
That sounds pretty interesting, Edouard! You need to duct tape the MPB to the dash of teh Buick so you can enjoy both hobbies at the same time! :)
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 12, 2013, 06:55:50 AM
Fine Edouard! Thats could be the solution!  [tup]

The shortway could be publish messages directly to FaceBook but I supopose this is not so easy...
Title: Solution mocked up (Re: Problems with Scripts to Twitter and Facebook)
Post by: elagache on November 12, 2013, 10:19:59 PM
Dear Federico, Steve, and WeatherCat script fans,

That sounds pretty interesting, Edouard! You need to duct tape the MPB to the dash of teh Buick so you can enjoy both hobbies at the same time! :)

Well, I don't get the feeling the poor old Buick is going to be getting much driving for a while.  There are new leaks and just to add insult to injury the company "fixing" the windshield wiper motor didn't find anything wrong.  However, they did break my extension I made to their switch so the original 1965 knob would work.  So now I fix that . . . . . . . .  just never seems to quit.    [banghead]


Fine Edouard! Thats could be the solution!  [tup]

Okay, I just finished mocking up a solution to that.  Here is a test of uploading the WeatherCat short forecast web tag to Twitter:

https://twitter.com/EdouardLagache/status/400376520209727488 (https://twitter.com/EdouardLagache/status/400376520209727488)

Let me polish it a little and I'll let you'all play with it.

The shortway could be publish messages directly to FaceBook but I supopose this is not so easy...

Sorry, I'm an open-source kind of guy and refuse to have anything to do with FaceBook.  I didn't even really want to have anything to do with Twitter, but at least Twitter isn't claiming to want to reinvent the Internet.  So, you would need to find somebody else for FaceBook troubles.

Cheers, Edouard  [cheers1]
Title: Re: Solution mocked up (Re: Problems with Scripts to Twitter and Facebook)
Post by: meteoperugia on November 13, 2013, 02:54:01 PM

Okay, I just finished mocking up a solution to that.  Here is a test of uploading the WeatherCat short forecast web tag to Twitter:

https://twitter.com/EdouardLagache/status/400376520209727488 (https://twitter.com/EdouardLagache/status/400376520209727488)

Let me polish it a little and I'll let you'all play with it.

Thanks Edouard. Could be fine and I can custom the script with different WC web tags is the answer to my original question.  [tup]
Waiting for you news, many thanks again!  [cheers1]

Quote
Sorry, I'm an open-source kind of guy and refuse to have anything to do with FaceBook.  I didn't even really want to have anything to do with Twitter, but at least Twitter isn't claiming to want to reinvent the Internet.  So, you would need to find somebody else for FaceBook troubles.

Facebook is just a way to write/read informations and news. I'm not even a FaceBook's fan but there are many people who feel more comfortable reading weather data such as temperature wind or rain, as the trend and forecasts directly from the phone in a FB page rather than opena web page with a lot of data and often poorly displayed on the small display of a smartphone. So I made ​​a FB profile where these data are updated at regular intervals and the only way I know in order to do that automatically is through Twitter (I don't like it more than FaceBook and Twitter is less frequented than FB….at least in Italy). I was asking (and asking to Stu especially) if there is a way to send the automatic weather updates as simple text strings (WC web tags based) directly from WeatherCat to FaceBook as I do to CWOP, Weather Underground or other weather websites, but with different customizable data at different times and days (every hour or every monday or every 1st day of month etc…).
I believe that this could be a useful integration to WeatherCat also for the enormous spread of FB platform and extensive use that if people can do, including read the temperature and tomorrow's weather forecast….

Cheers  [cheers1]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: Steve on November 13, 2013, 10:05:45 PM
Edouard,

This looks fantastic! Will this be one that cam be duplicated, so that I could, say, have a daily and weekly summary? All I'd need to do would be copy, change tags, and wait time?

 --Daily script
-- Daily text file

--Weekly Script
--Weekly text file

--Alert (temp, wind, etc.)
--Alert text file
(launched by WeatherCat Alert)

Ah, the possibilities!

Thanks,
Steve
Title: Nah, could be!! (Re: Scripts to Twitter)
Post by: elagache on November 13, 2013, 11:30:47 PM
Howdy Steve and WeatherCat script fans,

This looks fantastic! Will this be one that cam be duplicated, so that I could, say, have a daily and weekly summary? All I'd need to do would be copy, change tags, and wait time?

Well, you might need to put back the J.C. Computing libraries after making a copy.  I just tried my copies and didn't get what I expected at first.  But if you replace the libraries like you might have to do with WC Twitter Uploader, then the AppleScript works for sure.

Then you can upload anything that you can create as a WC webtag to Twitter.  Just create a WeatherCat web template that has the webtags you want converted into text and allow WeatherCat to process the template.  It is that text file that the AppleScripts will then upload.  You then modify the AppleScript to have the path to the file you want uploaded to Twitter.  Then you run the AppleScript.  If you want an automated operation just use Cronnix to set the time when the AppleScripts are launched.  Also, indeed custom alerts could be uploaded to Twitter.

There is one "gotcha" that just tripped me up.  WeatherCat tried to produce HTML formatting.  Twitter wants very plain text.  My latest test failed because the string I was trying to upload to Twitter had characters that Twitter doesn't support.  So stay tuned.  I'm closing in on this but as usual, lots of things on my plate.

Cheers, Edouard  [cheers1]

P.S. In the latest twist on my poor station wagon, the brand new alternator just died  . . . . . . . Ahhhhhhhhhhhhhh!!!!!!!  [banghead]
Title: Re: Nah, could be!! (Re: Scripts to Twitter)
Post by: Steve on November 14, 2013, 01:31:47 AM
P.S. In the latest twist on my poor station wagon, the brand new alternator just died  . . . . . . . Ahhhhhhhhhhhhhh!!!!!!!  [banghead]

That's just crazy! Did you source these parts, or has your builder cheaped out on you? As you know, I'm having an MGA engine built, and I'm gonna mix modern and vintage components. I've had the carburetors rebuilt, and am having the water pump and dizzy rebuilt. (new water pumps are pot metal castings, while my original is cast iron, which will be resleeved.) But I'm buying a modern geared starter, and may switch to a GM alternator instead of my generator. I finally decided to stick with the 4-speed 3-synchro (not synched in 1-2 or R) instead of swapping in a British Ford full synchro 5-speed.

Good luck,
Steve
Title: You'll be sorry!! - Hopefully not! (Re: Scripts to Twitter)
Post by: elagache on November 14, 2013, 10:27:25 PM
Howdy Steve and WeatherCat automotive enthusiasts,

P.S. In the latest twist on my poor station wagon, the brand new alternator just died  . . . . . . . Ahhhhhhhhhhhhhh!!!!!!!  [banghead]

That's just crazy! Did you source these parts, or has your builder cheaped out on you?

In this case it was an off the shelf production part made by a performance parts manufacturer: Tuff Stuff Performance:

http://www.tuffstuffperformance.com/index.cfm/page/ptype=product/product_id=8312/category_id=270/home_id=-2/mode=prod/prd8312.htm (http://www.tuffstuffperformance.com/index.cfm/page/ptype=product/product_id=8312/category_id=270/home_id=-2/mode=prod/prd8312.htm)

Their products are American made and have a good reputation.  However, it only had a 1 year warranty and was installed back in August 2012.  Lucky me, this company does stand behind their products and they are going to let me return it for repairs.

As you know, I'm having an MGA engine built, and I'm gonna mix modern and vintage components.

 ;) . . . .  Don't do that!!  Da' gremlins will get ya' for sure!!  . . . (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/gremlin_emoticon.png)

I've had the carburetors rebuilt, and am having the water pump and dizzy rebuilt. (new water pumps are pot metal castings, while my original is cast iron, which will be resleeved.) But I'm buying a modern geared starter, and may switch to a GM alternator instead of my generator. I finally decided to stick with the 4-speed 3-synchro (not synched in 1-2 or R) instead of swapping in a British Ford full synchro 5-speed.

Seriously, that is very similar to the new engine for my trusty wagon.  I'm going more with modern components than you are, but there is plenty of stuff that had to be rebuilt.

What has been really scary for me that a company's past reputation just doesn't seem to be the reliable indicator that it used to be.  One of the reasons I went with an aftermarket electronic fuel injection system is that I was having a lot of trouble getting carburetors rebuilt properly.  The same rebuilder that had done a good job for me around 2000 started giving me junk.  One of my car collector friends had a nightmare when trying to restore his own first car: a 1957 Chevy Bel Air.  The restorer he chose had several strong recommendations, but the guy flaked out.  The fellow who built the engine for my wagon is still considered one of the best in the business, but even he has to admit he made an error in the head gaskets he selected for Biquette's engine.

So best of luck in your rebuild.  Still, do try to keep a close check on the project as much as possible!

Cheers, Edouard  [cheers1]

P.S. AppleScripts are coming along!
Title: Can't "twit" from a CronniX job. (Re: Scripts to Twitter and Facebook)
Post by: elagache on November 16, 2013, 10:30:02 PM
Dear WeatherCat AppleScript fans,

Unfortunately, I've run into a snag on trying to make the AppleScripts I proposed to solve this problem.  My test scripts work just fine if run them manually.  However, when run as a cron (Cronnix) job nothing gets posted to Twitter.  Worse, trying to run the AppleScript from a WeatherCat custom alert has the same null outcome.  I suspect this is a problem with the authentication strategy to make sure that "you are you" to Twitter.  I've sent an email to Jesse Almanrode to see if he has any thoughts.  However, this could be a deal breaker.

Sorry, we'll just have to see.

Cheers, Edouard
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: Steve on November 17, 2013, 03:54:32 AM
Thanks for giving it a go, Edouard. having it run every X seconds like the existing Twitter script doesn't work?

Steve
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 17, 2013, 09:04:29 PM
Twitter Authentication: that's my original issue. Scripts I showed and Cronnix are running perfectly but Twitter wants new rules of authentication and I can't guess the right way…  :'(
Title: Control problem. (Re: Problems with Scripts to Twitter and Facebook)
Post by: elagache on November 17, 2013, 11:17:18 PM
Dear Steve, Federico, and WeatherCat Twitter fans,

I haven't heard back from J.A. Computing yet, so the jury is out as to whether or not there is a way out of this.

Thanks for giving it a go, Edouard. having it run every X seconds like the existing Twitter script doesn't work?

Well, yes you could do that, but then the problem is - how to you know when you want to post the message?  For example, you suggested that you wanted the message to be launched when WeatherCat triggers a custom alert.  I don't know of an easy way to get a custom alert to communicate with an AppleScript that is running all the time.  As I understood it, people wanted to have additional weather information posted when something happened or say at specific times of the day (like the forecast text.)  The other thing that worries me a bit is creating some more of these 24/7 AppleScripts.  They use a lot of computing resources for what they accomplish.

Let's see if there is if J.A. comes up with an answer.  The simplest solution would be some way for these AppleScripts to be able to authenticate themselves when run from WeatherCat alert triggers or what-not.

Cheers, Edouard  [cheers1]
Title: Another way to skin this cat(fish!) (Re: Scripts to Twitter)
Post by: elagache on November 18, 2013, 09:52:55 PM
Dear WeatherCat Twitter fans,

While I was removing the tails off some shrimp for yesterday's dinner - I got an idear!! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/thinking_idea.gif)

I had forgotten that AppleScripts can script each other.  I use that trick to get the web tags from all the other AppleScripts to WC AppleScript Tags Processor.  I can use the same programming strategy to use WC Twitter Uploader to pull double-duty.  In addition to processing the overall conditions messages, I could have other AppleScripts "hand-over" additional text strings to  WC Twitter Uploader and have this AppleScript upload these as well.  Since this AppleScript does work now, it should be able to simply work a little harder.

It is going to take me a while to come up with this, but we are expecting a little rain (hurray! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/rain_happy.gif)) this week, so perhaps I can make some headway on the AppleScript upgrade.

Take tuned!

Cheers, Edouard  [cheers1]
Title: Re: Control problem. (Re: Problems with Scripts to Twitter and Facebook)
Post by: Steve on November 18, 2013, 10:35:22 PM
Well, yes you could do that, but then the problem is - how to you know when you want to post the message?  For example, you suggested that you wanted the message to be launched when WeatherCat triggers a custom alert.

Correct. What I tried last year was simply a daily summary set at XXXX seconds, but ran into no tags available for whatever I was trying then as well as problems getting two Twitter AppleScripts to work. I mentioned alerts as another interesting possibility.

Steve
Title: Solved . . . . meybe? . . . . (Re: Control problem for Scripts to Twitter)
Post by: elagache on November 19, 2013, 10:11:09 PM
Howdy Steve and WeatherCat scripters and twitters . . . . .

Correct. What I tried last year was simply a daily summary set at XXXX seconds, but ran into no tags available for whatever I was trying then as well as problems getting two Twitter AppleScripts to work. I mentioned alerts as another interesting possibility.

Well, as I watched the raindrops fall, I spliced into my WC Twitter Uploader script  new handler to receive strings sent from other AppleScripts.   I modified the idle loop to check once a minute for any strings that might have been forwarded from other scripts to be uploaded to Twitter.  Once a minute WC Twitter Uploader uploads to Twitter any strings that has been forwarded to it.

Then I hacked up a test call to forward a string to be sent to Twitter and . . . . . . . .

https://twitter.com/EdouardLagache/status/402891973838663680 (https://twitter.com/EdouardLagache/status/402891973838663680)

It isn't "Hello World" but it will due in a pinch.

Okay, building on that success, I modified the main AppleScript library file to provide a consistent way for other AppleScripts to send strings over to be queued up for uploading to Twitter.  Having done this, I retooled my test WC Forecast Twitter script and ran a second test . . . . . .

https://twitter.com/EdouardLagache/status/402914054328426496 (https://twitter.com/EdouardLagache/status/402914054328426496)

So, . . . . . . . . . . . .  so far so good!!  [bounce]

This is a more substantial revision of the AppleScript package, so it may take me a while to get this all ready for "showtime," but the overall scheme is looking good at the moment!

Stay tuned!

Cheers, Edouard  [cheers1]
Title: Update - cron jobs working okay. (Re: Scripts to Twitter)
Post by: elagache on November 20, 2013, 09:46:22 PM
Dear WeatherCat Twitter fans,

Just a quick update.  I have been running my modified WC Twitter Uploader for about a day and so far all is well.  In particular, the tests of launching AppleScripts via cron (CronniX) are getting text uploaded to Twitter at least most of the time (there was one failure this morning.)  I need to run a test of an AppleScript running from a WeatherCat custom alert.  I had modified my temperature AppleScripts, but the temperature has been fluctuating so little that none of my standard alerts have been triggered.

Today I had to put this on the back-burner to deal with wagon issues, but I'll try to get back to this soon.

So stay tuned! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/tune_in_TV_emoticon.gif)

Cheers, Edouard  [cheers1]
Title: Re: Problems with Scripts and Email to Twitter and Facebook
Post by: meteoperugia on November 21, 2013, 02:13:21 PM
Great Edouard……. we stay tuned!  [interesting]

About some failure in this side was just when sometime text string was over 140 digits. Twitter doesn't like it….  ;)
Title: Coming soon. (Re: Scripts to Twitter)
Post by: elagache on November 27, 2013, 10:41:32 PM
Dear Federico and WeatherCat Twitter fans,

I thought I should post here a quick update.  I had Steve Morris play "sekret agent" for me . .  (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/spy_smiley.jpg) . . and put my modified WC Twitter Uploader script through its paces while running on Mavericks.  Amazingly, everything worked without any major snags.

So all I have left to do is some brushing up, update the docs, and I'll be able to push it out the door!

Cheers, Edouard  [cheers1]