21301 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 777 Views |
-
onAfterWrite 500//There has been an error

13 December 2010 at 3:49pm
First off appologies for starting a new thread for this, I'm sure this has been covered.
I'm using onAfterWrite to auto tweet blog posts as follows.
function onAfterWrite() {
parent::onAfterWrite();
$this->Tweet();
}
function Tweet() {
$twitterObj = new EpiTwitter(
$TWITTER_CONSUMER_KEY="****",
$TWITTER_CONSUMER_SECRET="****",
$userToken="****",
$userSecret="****"
);
$twitterObj->post(
'/statuses/update.json',
array(
'status' => $this->Title.' '.Director::absoluteBaseURL().$this->Link()
)
);
}The above code doesn't help much, altough it is working, it's just an error on saving which also doesn't help much. Does anyone know what would cause 500//There has been an error Failed to load source (found in the console of Fire Bug)
For any one thats interested I'm using jmathai's Outh which can be downloaded here https://github.com/jmathai/twitter-async there is good documentation here http://www.jaisenmathai.com/articles/twitter-async-documentation.html#methodnames
-
Re: onAfterWrite 500//There has been an error

13 December 2010 at 4:36pm
The above code doesn't help much, altough it is working, it's just an error on saving which also doesn't help much. Does anyone know what would cause 500//There has been an error
Put the site into devmode (or look at the error logs on your webserver) and you should get a much more useful error message. Could be a number of things.
-
Re: onAfterWrite 500//There has been an error

13 December 2010 at 5:32pm
cough cough, thanks again Willr, don't know why I didn't think of that.....
line 245 EpiTwitter was throughing Exception, looks like the EpiTwitter is trying to post the tweet twice. This Oauth has been giving me a head ache so I lazily commented out the Exceptions, tweeting nicly and no save error, yea! thanks again
| 777 Views | ||
|
Page:
1
|
Go to Top |


