Zen Cart Logo
Forums / All Other Contributions/Addons / AutoTweet [support]

AutoTweet [support]

Views: 51,022

Results 181 to 200 of 264
6 Apr 2011, 12:48 PM
#181
davx avatar

davx

New Zenner

Join Date:
Nov 2009
Posts:
80
Plugin Contributions:
0

AutoTweet [support]

Hi all

How hard would this be to create a checkbox within the product details page to post that product onto twitter?

My issues;

  1. We add products and leave them offline while waiting for stock to arrive. These are autotweeted and we have to go and delete the tweet.

  2. Sometimes old products are edited (new style or type) so we would like to tweet again.

  3. Some products are added to hidden sections for newsletter subscribers only, these automatically get posted and we have to go deleting them.

Kind Regards

Dave

6 Apr 2011, 4:16 PM
#182
mobile_gear avatar

mobile_gear

New Zenner

Join Date:
Feb 2011
Posts:
9
Plugin Contributions:
0

Re: AutoTweet [support]

Hi,

I need some help I have added the autotweet module but I doesn't function? I don't get any errors when I add a product?

This is the code that I have put in I have change the key's and passwords for security but I wanted to check the basics are right.

// start autoTweet 3.0
//User Settings.
$consumerKey = "0gWLhuXHSzdImWWo9gE9qg"; //twitter app consumer key.
$consumerSecret = "0GiGSTVSwdhQEk9mr26dIkGgzSagwSy0yLz9KQ"; //twitter app consumer secret.
$oauthToken = "247733275-bwLM6B7o925J8f4ZPKWpoOfCGggz6HAtNUS8KuDU"; //twitter app "my access" token
$oauthTokenSecret = "NzrnYbuqv9LosZ1kwx9aWkgFSx4xdfDVYzVZZv7Xs4Y"; //twitter app "my access" token secret.
$twitUsername = "mobilegearuk";
$twitPassword = "******";
$bitlyUsername = "mobilegearuk"; //bit.ly username
$bitApiKey = "R_4c7acc2b6a341dfdf796fa414dd877f46"; //bit.ly api key.
$storeUrl = "http://www.mobile-gear.co.uk"; //url to the homepage of your store.
$showprice = 0; // Show the product price? 0 = off, 1 = on. no quotes.
$timeout = 10; //seconds to wait for twitter & bit.ly. This can be left alone.

//do not edit below this line.

Should I be able to see the module in my admin section under modules and do I need to turn it on?

Thanks in advance

Nick

7 Apr 2011, 7:56 AM
#183
davx avatar

davx

New Zenner

Join Date:
Nov 2009
Posts:
80
Plugin Contributions:
0

Re: AutoTweet [support]

Nick

I'm no expert but have this working, here is a copy of mine, try modifying this with your data.

// start autoTweet 3.0
//User Settings.
$consumerKey = "xxxxxxxxxxxxxxx"; //twitter app consumer key.
$consumerSecret = "xxxxxxxxxxxxxx"; //twitter app consumer secret.
$oauthToken = "xxxxxxxxxxxxxxxxx"; //twitter app "my access" token
$oauthTokenSecret = "xxxxxxxxxxxxxxxx"; //twitter app "my access" token secret.
$bitlyUsername = "bitly2011"; //bit.ly username
$bitApiKey = "R_8888888888888888888888883"; //bit.ly api key.
$storeUrl = "www.domain.co.uk"; //url to the homepage of your store no http.
$showprice = 0; // Show the product price? 0 = off, 1 = on. no quotes.
$timeout = 10; //seconds to wait for twitter & bit.ly. This can be left alone.

//do not edit below this line.
$prodUrl = urlencode(zen_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id));
//short url function.
function shortenUrl($user, $key, $shortenUrl){
    $url = 'http://api.bit.ly/v3/shorten?login=' . $user .'&apiKey='. $key . '&longUrl=' . $shortenUrl . '&format=xml';

          $ch = curl_init();
          curl_setopt($ch,CURLOPT_URL,$url);
          curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, $timeout);
          $data = curl_exec($ch);
          curl_close($ch);
    return $data;
}
//use oAuth library
require_once 'twitteroauth/twitteroauth.php';
//function to shorten url
$shorten = shortenUrl($bitlyUsername, $bitApiKey, $prodUrl);
//start message w/ or w/out price
$message = "New product available: " . $_POST['products_name'][$_SESSION['languages_id']] . '!';
if ($showprice){ $message .=  ' Only $' . $products_price . '.'; }
//if shorten fails use $storeUrl
$bitStatus = simplexml_load_string($shorten);
$http_code = $bitStatus->status_code;
$status_txt = $bitStatus->status_txt;
if ($http_code != 200){$shorten = $storeUrl;
    $biterror = "URL was not shortened for Twitter: ";
    $biterror .= $storeUrl . " was used instead.";
    $biterror .= " Reason: " . $status_txt;
   $messageStack->add_session($biterror, 'caution');
} else { $shorten = $bitStatus->data->url;}
//finish message.
$message .= ' Check it out now at ' . $shorten;
//the connection to twitter API
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$connection->timeout = $timeout;
$connection->connecttimeout = $timeout;
//send message
$tweet = $connection->post('statuses/update', array('status' => $message));
//error check
if ($connection->http_code != NULL){
    if ($connection->http_code != 200){
    $error = "Twitter could not be updated: " . $connection->http_header["status"] . ": ";
    $error .= $tweet->error;
    $error .= "<br />To paste the code into twitter yourself use: <br />" . $message;
    $messageStack->add_session($error, 'error');
    } else {
     $messageStack->add_session('Twitter Updated!', 'success');
    }
} else {
  $error = "Twitter could not be updated: Could not connect or there was nothing to do once connected.<br />
  Twitter may be down or over capacity. To paste the code into twitter yourself use: <br />";
  $messageStack->add_session($error, 'error');
  $messageStack->add_session($message, 'caution');
}
// end autoTweet 3.0

Regards Dave

22 Apr 2011, 3:34 PM
#184
kbear avatar

kbear

New Zenner

Join Date:
Mar 2011
Location:
In a green and pleasant land
Posts:
46
Plugin Contributions:
0

Re: AutoTweet [support]

Hi did you ever solve the problem of Twitter could not be updated: 401 Unauthorized: Could not authenticate you.

I have it now and cannot find an answer

30 Apr 2011, 6:37 AM
#185
willie_bee avatar

willie_bee

Zen Follower

Join Date:
Mar 2011
Posts:
386
Plugin Contributions:
0

Re: AutoTweet [support]

kbear:

Hi did you ever solve the problem of Twitter could not be updated: 401 Unauthorized: Could not authenticate you.

I have it now and cannot find an answer

I read through all 19 pages and could not find an answer also. I am getting the same error and have checked and doubled checked everything.

1.3.9h and 5.2.17 php

30 Apr 2011, 5:15 PM
#186
gnro avatar

gnro

New Zenner

Join Date:
Jun 2009
Posts:
9
Plugin Contributions:
0

Re: AutoTweet [support]

willie bee:

I read through all 19 pages and could not find an answer also. I am getting the same error and have checked and doubled checked everything.

1.3.9h and 5.2.17 php

My opinion is that somewhere in your configurable options you use some special characters. Maybe your password? If that's true try to escape those chars, or try changing user, secret or password.

Hope this will help!

30 Apr 2011, 8:52 PM
#187
willie_bee avatar

willie_bee

Zen Follower

Join Date:
Mar 2011
Posts:
386
Plugin Contributions:
0

Re: AutoTweet [support]

gnro:

My opinion is that somewhere in your configurable options you use some special characters. Maybe your password? If that's true try to escape those chars, or try changing user, secret or password.

Hope this will help!

That makes no sense. Everything is generated by the Twitter API. You no longer use your logon and password in the update product.

3 May 2011, 1:03 AM
#188
willie_bee avatar

willie_bee

Zen Follower

Join Date:
Mar 2011
Posts:
386
Plugin Contributions:
0

Re: AutoTweet [support]

Anyone else? I was able to get the AutoFacebook working.

16 Jun 2011, 7:47 AM
#189
shawnhbk avatar

shawnhbk

New Zenner

Join Date:
May 2011
Posts:
19
Plugin Contributions:
0

Re: AutoTweet [support]

Is it possible to tweet products already in database?

18 Jun 2011, 2:22 AM
#190
lingerieholic avatar

lingerieholic

New Zenner

Join Date:
Jun 2011
Posts:
4
Plugin Contributions:
0

Re: AutoTweet [support]

Will Autotweet 3.0 work with Zencart 1.38a? I have followed instructions and it does nothing. Please help. Thanks

26 Jul 2011, 9:00 AM
#191
treefrog avatar

treefrog

New Zenner

Join Date:
Nov 2009
Location:
West Yorkshire, UK
Posts:
13
Plugin Contributions:
0

Re: AutoTweet [support]

shawnhbk:

Is it possible to tweet products already in database?
did you solve your issue regarding tweeting products already in Database? I have it working to tweet on Update rather than insert product

2 Aug 2011, 12:24 PM
#192
comedyshirts avatar

comedyshirts

New Zenner

Join Date:
Jun 2010
Location:
Leeds
Posts:
6
Plugin Contributions:
0

Re: AutoTweet [support]

I tried to add this to my Zen Cart, thought I had done all correctly but am getting the error codes below:

Warning URL was not shortened for Twitter: http://www.comedyshirts.co.uk was used instead. Reason: INVALID_LOGIN
Error Twitter could not be updated: 401 Unauthorized: Read-only application cannot POST
To paste the code into twitter yourself use:
New product available: 'Your design' mug! Check it out now at http://www.comedyshirts.co.uk

Help would be much appreciated.

Thanks
Tony

2 Aug 2011, 1:10 PM
#193
treefrog avatar

treefrog

New Zenner

Join Date:
Nov 2009
Location:
West Yorkshire, UK
Posts:
13
Plugin Contributions:
0

Re: AutoTweet [support]

comedyshirts:

I tried to add this to my Zen Cart, thought I had done all correctly but am getting the error codes below:

Warning URL was not shortened for Twitter: http://www.comedyshirts.co.uk was used instead. Reason: INVALID_LOGIN
Error Twitter could not be updated: 401 Unauthorized: Read-only application cannot POST
To paste the code into twitter yourself use:
New product available: 'Your design' mug! Check it out now at http://www.comedyshirts.co.uk

Help would be much appreciated.

Thanks
Tony
Sounds like your Twitter app Access Level is set to Read Only
try log into Twitter dev https://dev.twitter.com/apps

Find your application, go to settings and Select 'Read and Write' from application type.

Hope that helps.

2 Aug 2011, 1:21 PM
#194
treefrog avatar

treefrog

New Zenner

Join Date:
Nov 2009
Location:
West Yorkshire, UK
Posts:
13
Plugin Contributions:
0

Re: AutoTweet [support]

Also you will need to check your bit.ly api keys and tokens (ADMIN/INCLUDES>MODULES>update_product.php)
Sounds like it's mis-configured

https://bitly.com/

Hope that helps.

2 Aug 2011, 2:00 PM
#195
comedyshirts avatar

comedyshirts

New Zenner

Join Date:
Jun 2010
Location:
Leeds
Posts:
6
Plugin Contributions:
0

Re: AutoTweet [support]

Hi Treefrog

Thanks for the advice.
I just set to read/write and had to enter the revised access codes.
Put a new item in the shop and got no error codes, but no confirmation either!
Should it tell you it has been twittered!
So far no tweet has come through.

Cheers
Tony

2 Aug 2011, 2:35 PM
#196
treefrog avatar

treefrog

New Zenner

Join Date:
Nov 2009
Location:
West Yorkshire, UK
Posts:
13
Plugin Contributions:
0

Re: AutoTweet [support]

Hi,
you should get 'success' message at the top of the screen after update.
Note, standard set up of this Mod will only Tweet on New Products added, rather than upon product updated.
You can adjust to have it tweet on update though if needed,
I have set up to tweet on update with option to 'not tweet' (handy when you make a tiny change, or working on an 'offline' product)

2 Aug 2011, 2:39 PM
#197
comedyshirts avatar

comedyshirts

New Zenner

Join Date:
Jun 2010
Location:
Leeds
Posts:
6
Plugin Contributions:
0

Re: AutoTweet [support]

Sorry if I sound a bit thick here, when you say you get a 'success' message at the top of the screen, where would this be?
My shop control panel?
The Dev Twitter?

It is quite new to me, so I am a complete novice with the php stuff!

2 Aug 2011, 2:49 PM
#198
treefrog avatar

treefrog

New Zenner

Join Date:
Nov 2009
Location:
West Yorkshire, UK
Posts:
13
Plugin Contributions:
0

Re: AutoTweet [support]

comedyshirts:

Sorry if I sound a bit thick here, when you say you get a 'success' message at the top of the screen, where would this be?
My shop control panel?
The Dev Twitter?

It is quite new to me, so I am a complete novice with the php stuff!

Sorry Sometimes i don't explain too well, your success message should be at the top of the screen in zen admin,
In my case a thin green line above the shop logo "Success Twitter Updated!" ..

2 Aug 2011, 3:24 PM
#199
comedyshirts avatar

comedyshirts

New Zenner

Join Date:
Jun 2010
Location:
Leeds
Posts:
6
Plugin Contributions:
0

Re: AutoTweet [support]

Thanks for the explanation< I'm not getting that so I guess it's back to the drawing board!!
Will sleep on it and try tomorrow, otherwise the computer may be attacked

15 Aug 2011, 2:27 AM
#200
linux avatar

linux

Zen Follower

Join Date:
Apr 2004
Posts:
173
Plugin Contributions:
0

Re: AutoTweet [support]

PinkLeopard:

Jamie...luv you for a such a great addon...:clap:

One little tiny fix if you can?

1980's is showing up 1980\s.

Is this possible to fix this?

Getting the same issue.

Any fix for this?

Thanks