What is the name of this Auto Tweet add on ? Had one before but it did not have the option to turn it off.
Printable View
What is the name of this Auto Tweet add on ? Had one before but it did not have the option to turn it off.
has anybody here gotten auto tweeter and auto facebook to work simultaneously?? i notice they both have to update update_product.php ??
Ok I found out how to get this to work in conjunction with AutoFB. I had always put the Tweet code AFTER the AutoFB code in update_product.php. You have to put it BEFORE and it works. Don't know why. Don't care. It works.
Will this mod will automatically update twitter if you have any promotions and specials that have on the site?
Hi all,
This sounds like a great mod, however I am having difficulty with it.
I have followed the install Readme, setup a Twitter account as well as a bitly account. Set them up and when I add a product now I am getting the message at the top left of my screen stating that "Twitter Updated!" per the image attached. But when I go to my twitter account there is absolutely nothing showing other then "@keystoneairsoft hasn't tweeted yet."
Not sure where I am going wrong. Would be great if someone can point me in some kind of right direction to get this fixed.
Thanks much in advance.
Ron S.
Update!!
Ok I got it to finally upload to the bitly site, however it is still not posting on my Twitter Page. I have Share enabled on the bitly site with all my credentials but will not automatically send to Twitter.
Now, however I am able to go to the bitly site and click on the product and when the display box shows up on the right and I click "Share" it will post to my Twitter account. I have checked all settings on bitly and twitter and seems everything is right but apparently it isn't.
Any help would be greatly appreciated.
Ron S.
today auto tweet work stop in my 2 sites, i am not change any thing in script or website and also not show any type error.
any one help me, how to solve this problem ?
Hello developer!...
Is there a way to get the autotweet to display a special format Price like this (Without the quotes"): "New Product online: xyzname only € 12,00 (excl. VAT) ... "
how does the code look like for this format, caus I cannot get it to look like this... it always looks like
" EURO 12.0000 " and not
" € 12,00 " ....
how to program this?
Thanks for help!
thanks for this great module.
can you add http://adf.ly API in this module at this time you use bitly.com API
if any one help me.
code:
-------------------------------------------------------------------------------------
<?php
/**
* @package admin
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: update_product.php 15636 2010-03-07 07:00:40Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (isset($_GET['pID'])) $products_id = zen_db_prepare_input($_GET['pID']);
if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) {
$action = 'new_product';
} elseif ($_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') {
$products_date_available = zen_db_prepare_input($_POST['products_date_available']);
$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
// Data-cleaning to prevent MySQL5 data-type mismatch errors:
$tmp_value = zen_db_prepare_input($_POST['products_quantity']);
$products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['products_price']);
$products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['products_weight']);
$products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['manufacturers_id']);
$manufacturers_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$sql_data_array = array('products_quantity' => $products_quantity,
'products_type' => zen_db_prepare_input($_GET['product_type']),
'products_model' => zen_db_prepare_input($_POST['products_model']),
'products_price' => $products_price,
'products_date_available' => $products_date_available,
'products_weight' => $products_weight,
'products_status' => zen_db_prepare_input((int)$_POST['products_status']),
'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']),
'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']),
'manufacturers_id' => $manufacturers_id,
'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']),
'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']),
'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']),
'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']),
'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']),
'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']),
'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']),
'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']),
'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']),
'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']),
'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']),
'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']),
'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])
);
// when set to none remove from database
// is out dated for browsers use radio only
$sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image']);
$new_image= 'true';
if ($_POST['image_delete'] == 1) {
$sql_data_array['products_image'] = '';
$new_image= 'false';
}
if ($_POST['image_delete'] == 1) {
$sql_data_array['products_image'] = '';
$new_image= 'false';
}
if ($action == 'insert_product') {
$insert_sql_data = array( 'products_date_added' => 'now()',
'master_categories_id' => (int)$current_category_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
zen_db_perform(TABLE_PRODUCTS, $sql_data_array);
$products_id = zen_db_insert_id();
// reset products_price_sorter for searches etc.
zen_update_products_price_sorter($products_id);
$db->Execute("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . "
(products_id, categories_id)
values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////
// start autoTweet 3.0
//User Settings.
$consumerKey = "Your twitter app consumer key"; //twitter app consumer key.
$consumerSecret = "Your twitter app consumer secret"; //twitter app consumer secret.
$oauthToken = "Your my access oauth token"; //twitter app "my access" token
$oauthTokenSecret = "Your my access oauth token secret"; //twitter app "my access" token secret.
$bitlyUsername = "your bitly username"; //bit.ly username
$bitApiKey = "Your bitly API key"; //bit.ly api key.
$storeUrl = "www.your-store.com"; //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.
$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
//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
///////////////////////////////////////////////////////
} elseif ($action == 'update_product') {
$update_sql_data = array( 'products_last_modified' => 'now()',
'master_categories_id' => ($_POST['master_category'] > 0 ? zen_db_prepare_input($_POST['master_category']) : zen_db_prepare_input($_POST['master_categories_id'])));
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
zen_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
// reset products_price_sorter for searches etc.
zen_update_products_price_sorter((int)$products_id);
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
}
$languages = zen_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$language_id = $languages[$i]['id'];
$sql_data_array = array('products_name' => zen_db_prepare_input($_POST['products_name'][$language_id]),
'products_description' => zen_db_prepare_input($_POST['products_description'][$language_id]),
'products_url' => zen_db_prepare_input($_POST['products_url'][$language_id]));
if ($action == 'insert_product') {
$insert_sql_data = array('products_id' => $products_id,
'language_id' => $language_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update_product') {
zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
}
}
// add meta tags
$languages = zen_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$language_id = $languages[$i]['id'];
$sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));
if ($action == 'insert_product_meta_tags') {
$insert_sql_data = array('products_id' => $products_id,
'language_id' => $language_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update_product_meta_tags') {
zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
}
}
// future image handler code
define('IMAGE_MANAGER_HANDLER', 0);
define('DIR_IMAGEMAGICK', '');
if ($new_image == 'true' and IMAGE_MANAGER_HANDLER >= 1) {
$src= DIR_FS_CATALOG . DIR_WS_IMAGES . zen_get_products_image((int)$products_id);
$filename_small= $src;
preg_match("/.*\/(.*)\.(\w*)$/", $src, $fname);
list($oiwidth, $oiheight, $oitype) = getimagesize($src);
$small_width= SMALL_IMAGE_WIDTH;
$small_height= SMALL_IMAGE_HEIGHT;
$medium_width= MEDIUM_IMAGE_WIDTH;
$medium_height= MEDIUM_IMAGE_HEIGHT;
$large_width= LARGE_IMAGE_WIDTH;
$large_height= LARGE_IMAGE_HEIGHT;
$k = max($oiheight / $small_height, $oiwidth / $small_width); //use smallest size
$small_width = round($oiwidth / $k);
$small_height = round($oiheight / $k);
$k = max($oiheight / $medium_height, $oiwidth / $medium_width); //use smallest size
$medium_width = round($oiwidth / $k);
$medium_height = round($oiheight / $k);
$large_width= $oiwidth;
$large_height= $oiheight;
$products_image = zen_get_products_image((int)$products_id);
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = preg_replace('/'.$products_image_extension.'/', '', $products_image);
$filename_medium = DIR_FS_CATALOG . DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . '.' . $fname[2];
$filename_large = DIR_FS_CATALOG . DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . '.' . $fname[2];
// ImageMagick
if (IMAGE_MANAGER_HANDLER == '1') {
copy($src, $filename_large);
copy($src, $filename_medium);
exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $large_width . " " . $filename_large);
exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $medium_width . " " . $filename_medium);
exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $small_width . " " . $filename_small);
}
}
zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' . $_POST['search'] : '') ));
} else {
$messageStack->add_session(ERROR_NO_DATA_TO_SAVE, 'error');
zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' . $_POST['search'] : '') ));
}
-------------------------------------------------------------------------------------
I am having trouble... Running ZC 1.5.0 and installed the newest version of AutoTweet.. but when I make a new product I get this:
URL was not shortened for Twitter: www.opalessenceshop.com was used instead. Reason: INVALID_LOGIN
Twitter could not be updated: 401 Unauthorized: Could not authenticate you.
To paste the code into twitter yourself use:
New product available: Natural Vanilla Flavored Lip Balm .15oz! Only $3.07. Check it out now at www.opalessenceshop.com
Now, my file was not as described in the readme file:
The readme file says it will be like this:
Mine looked like this:Quote:
Now edit lines 96 through 100 like so:
a. $twitUsername = your twitter user name.
b. $twitPassword = your twitter password.
c. $bitlyUsername = your bit.ly user name (available for free at www.bit.ly)
d. $bitApiKey = your bit.ly API Key, find it by logging in to bit.ly and clicking settings.
So I'm not sure what to do... can anyone help?Quote:
Now edit lines 96 through 100 like so:
$oauthToken = "Enter oauthToken here"; //twitter app "my access" token
$oauthTokenSecret = "Enter oauthTokenSecret here"; //twitter app "my access" token secret.
$bitlyUsername = "your bit.ly user name"; //bit.ly username
$bitApiKey = "your bit.ly API Key"; //bit.ly api key.
Ok I got the thing to tweet to twitter, but it still says
URL was not shortened for Twitter: www.opalessenceshop.com was used instead. Reason: INVALID_LOGIN
I have reset my bit.ly API key, so I know that's right... I think my username is OpalEssenceShop... at the top of the page it says, for example, "@OpalEssenceShop Account Settings" (at https://bitly.com/a/account) so what is going wrong?
And treefrog, how did you get it to tweet on update with an option to not tweet? I'd really like that, because a lot of times I add products when I have time, ahead of when they're actually ready to sell, then make the product and go in and change the status of the product or change the quantity from 0 to 5 or whatever--and I'd like to tweet it *then*...
Hey folks! I added this mod earlier today and I was getting the 401 error like many of you are. I did 2 things to fix it. I'm not sure which one was the cure.
1. I created a new app and used the new #'s it gave me for the code
2. for some reason when I copied and pasted from the Twitter developer page, there were extra spaces after " and the beginning of the auth codes. I deleted the space.
The app works perfectly now I just wish there was a way to turn it off and on.
2 questions:
1) I tried following the directions here: http://www.zen-cart.com/showthread.p...322#post996322 but replacing stuff with "twitter" but it didn't work... in an ideal world I would have both AutoFacebook and AutoTweet at the bottom of the page and with yes/no checkboxes... could someone who knows how to code better than me (just about any 3rd grader, for example) tell me where exactly to move my AutoTweet* and AutoFacebook code to in the page, and verify/fix the checkboxes thing so that it works?
2) More of a cosmetic thing, but when it sends a tweet with my new products, it lists their price with four decimal places. For example "$3.1200" ...is there something I can tweak to fix that? It just looks silly.
*I already have my AutoTweet code near the bottom of the page, and it tweets on add AND update, but I want to be able to turn it off if I'm making lots of small changes so I don't flood my stream. When I moved AutoFacebook to the same area, it all broke.
I am installing the Auto-tweet mod and have a question regarding how to set up the twitter dev app. The website and callback are the 2 questions that I am uncertain how to answer. The Zencart 1.50 site url is: store.bbiclan.com, and my twitter account is @TheMortician4. What inputs should I place in these pages?
Is anybody else experiencing problems, I havent put any new products on since April and now it doesnt seem to work, no errors that I can see, is it just me or has something changed with Bit:ly??
Can any one help, please?
I have battled the whole day to get the autottweet to work but am getting the same problem:
"URL was not shortened for Twitter: west-net.co.za was used instead. Reason: INVALID_LOGIN"
site:twitter:HTML Code:www.west-net.co.za
What i've done so farHTML Code:https://twitter.com/WestNet1
Reset the Twitter API
Reset the Bitly API
Deleted and reconnected the account in Bitly
Cleared history and cache
Tripple checked usernames tokens etc.
One thing i'm not sure about is curl it is enabled on my wamp but not sure how to do it on the server
Any HELP would greatly be appreciated:smile:
many thanks newbie@westnet
Hi Everyone, Im hvaving the following issues:
Twitter could not be updated: 401 Unauthorized: Read-only application cannot POST
To paste the code into twitter yourself use:
New product available: Pewter Skull & Guitars Pendant! Check it out now at http://bit.ly/TDo7kX
Not sure what to do any help is appreciated. Have a great Sunday.
Donovan
Hi there, you need to go back to your twitter api and under the settings tab of your application, scroll down to Application type and select Read and Write. Then at the bottom, click the update button.
Now click on the Rest Keys Tab and reset your application keys.
Next go to the Details Tab, scroll down and click the "recreate my access token" button.
Afterwards copy your new consumer key & secret as well as your new access token key and secret to the update.php file and upload to server.
Add a new product and it should work then.
I have one little problem that I need help with please.
Currently my store's default currency is Rands, but with the auto-tweet, the prices in the tweets are displayed in $ instead of the default R.
How to fix this?
Hi, got this to work and it works great, so thx! But I have a question/request; is it possible to create/add som code so I can chose if I want to update twitter or not?
For example, this is what I mean (yeh.. photoshop):
Why? Because I sometimes have a whole serie of products that are the same, but just have different sizes. I dont want to work with product attributes, in our case thats not practical. So one update is actually enough and I dont want followers to leave me because of to many tweets :)
I'm having same issue as others:
I've done the reset process and verification 3 times. No success.Quote:
Twitter could not be updated: 401 Unauthorized: Could not authenticate with OAuth.
Also I'm having this warning:
Which was also mentioned by another person.Quote:
The AutoFB works perfectly but not this one.
May someone give us some light?
Is anybody currently having problems with this?
Hi ideasgirl,
If you created your bitly account using your twitter or facebook account i.e. (Upon going to bitly.com, if you signed up using twitter or facebook) what you'll have to do after account was created on bitly is click on the 'Advanced tab' from settings and look for "Legacy API Key If you already use a bitly API key to grant access to 3rd party applications, you can reset it here. Show legacy API key"
click on the 'Show legacy API key'
There you will find you true login and api key, and not that of your username e.g. @twitter_username.
Hope this helps anyone with that problem
Is it possible to add the product image to the rest of the info that posts at Twitter? I know you can upload images from your hard drive, but will a link code to the image work, as it does in auto Facebook?
Thanks,
Joanne
Couple questions:
Has anyone managed to get this mod to work on v1.5.1?
Hate to admit but I could not.
Why the use of a 3rd party to shorten URL?
Twitter has a built in link service. A URL of any length will be altered to 20 characters, even if the link itself is less than 20 characters long. Your character count will reflect this.
Why grant any service access to your accounts ...
Has anyone else noticed Twitter changed their API URLS?
None of the URLS in the twitteroauth.php matched my URLS in the twitter > my applications.
Just curious
Twitter just forced everyone on v1.0 of the API to use v1.1 (Looks like they started enforcing this today). You will need to switch the twitter library over to the new version to get this working. When I have time I will definitely update the script, however I don't know when that will be. See: https://dev.twitter.com/docs/api/1.1/overview
As for the 3rd party question, this mod predates twitter's adding of that feature. It used to be if you wanted a URL shortened you need a 3rd party service to do so.
Thank you for clarifying :smile:
Here are the API URLS
function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }
function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; }
function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }
I have this working now, however I use my own code in update_products.php so I can choose too or not too send new product tweets, choose too include or exclude products price, choose too or not too send product update tweets and include hash tags.
I am new to twitter but I guess we all are or were at some point.
/YOUR_ADMIN_FOLDER/includes/modules/twitteroauth/twitteroauth.php
need to change this:
public $host = "https://api.twitter.com/1/";
to:
public $host = "https://api.twitter.com/1.1/";
line 19 in my file
and change this:
function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }
function authenticateURL() { return 'https://twitter.com/oauth/authenticate'; }
function authorizeURL() { return 'https://twitter.com/oauth/authorize'; }
function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }
to:
function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }
function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; }
function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }
line 43 - 46 in my file
I am just doing a quick view of my files for they differ from autotweet3's
I have not tried to add an image.
Why would you want to - twitter is not a shopping cart, your website is. Give just enough to get your followers to click the link to your website to make the purchase.
ok changed the first line of code - but the 4 lines of code, is it just me, or is the 2nd set exactly the same as the first set that need to be changed? OK never mind, I just noticed the api's lol
if your talking about the twitter username and password at the bottom of the file they are null and void (not needed)
and you shouldn't have to update or reset the key and or secret in the /YOUR_ADMIN_FOLDER/includes/modules/update_product.php file
Has anyone suffered issues with autotweet the last few days? i havent changed anything but now its asking me to manually update twitter.. i can only assume twitter have changed something on their backend?
Hello. I am trying to integrate autotweet with autofacebook. I have autofacebook installed and working perfectly (thank you for this script!) but I am not able to get the integration of the two working. When I try and add something in my store it still just says that facebook was updated and no mention of twitter and no twitter post. So clearly the code I snipped out of update_product.php was not all that I needed or something. Please help.
I have updated all the consumer key & secret the new access taken key & secret, but I am still getting the following error at the top of my admin page.
How can I fix this problem?
Attachment 12877
Did you update the twitter api addresses? post #235
Glad you got it working!
I just installed Autotweet 3.0, and I filled in all information for update_product.php. But there is no way that I get products uploaded to Twiter. The error message I received as followings:
Twitter could not be updated: :
To paste the code into twitter yourself use:
New product available: Full/Queen Bed Modern Bedding Sports Duvet Cover Set Le Vele LE132Q! Only $148.95. Check it out now at http://bit.ly/1b2CvZh
On the instruction page, step number 6 tells me to fill in username and password of twitter, but I do not see any places to fill in username and password.
6. Now edit lines 96 through 100 like so:
a. $twitUsername = your twitter user name.
b. $twitPassword = your twitter password.
Please help me out with this. Thanks so much for your help and support.
ttmb33
I did follow Post #35 to change to https://api.twitter.com/1.1/ , but I still get the error as followings:
Twitter could not be updated: 403 Forbidden:
To paste the code into twitter yourself use:
New product available: Full/Queen Modern Bedding Floral Duvet Cover Set, Dophia DO138Q! Only $134.95. Check it out now at http://bit.ly/1gvG1U5
Please helps. Thanks!
Did you change the following also:
function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; }
Hi
Can't believe I didn't see this Plugin Before Now! Got it working great on 1.5.1 with picaflor-azul Sheffield Blue Responsive Template on the site I manage. www.johnwoodsmotorcare.net
I've been through the whole thread twice and although I don't think I've missed it, can someone point me in the right direction with the code for setting the plugin to give the option to re-tweet the listing if a product is updated (along with the code and where to put it)?
Thanks
Mark
I Have tried & Done All The Changes ((address, AIP's, ect...), & Have Had The Same Issue... I Also Use AutoFacbook (Great Mod BTW... WORKS GREAT!!!) But I Still Get An Error Telling Me To Manually Enter My Tweet.....
Twitter could not be updated: :
To paste the code into twitter yourself use:
blah, blah, blah.....
Please HELP!!!!!
:frusty:
I was wondering if anyone has used this with Zen 1.51 and eMagicOne Store Manager or do you have to add products thru admin ?
Thanks in advance
Carl
I know this is a dumb question but why isn't there $twitUsername or $twitPassword? I completed all directions but entering my twitter username and password in update_product.php because I can't find those lines. Did I get a bad download?
okay I sorted out my twitname and twitpass issue out by linking my bitly account to twitter.
Im having this error now: Warning URL was not shortened for Twitter: www.mydomain.com was used instead. Reason: INVALID_APIKEY
Error Twitter could not be updated: :
To paste the code into twitter yourself use:
New product available: testing! Only $23. Check it out now at www.mydomain.com
what's causing this? I have my twitter api settings as read and write and generated new keys&tokens after the change and updated my update_product.php??? I also updated twitters api addresses????????
ZC1.5.3.
When creating product and click on insert it shows blank page
timeout was 10, changed to 0 but still blank page
$timeout = 0; //seconds to wait for twitter & bit.ly. This can be left alone.
New question I think
when you replace your existing update_product.php do you know what lines are added?
I belive my update file has been changed some already and don't want to loose what I have
so just want to edit and add missing lines
thanks
Dave
is anyone using this now... bit.ly has changed there api to tokesn;and i don't know what to do..
thank you
Was wondering if anyone has upgraded twitteroauth.php to include media uploads yet?
I'm getting close, but just rain into a 'Uncaught InvalidArgumentException: You must supply a readable file in' using the url to the image as..
Then after connection trying to upload and get the media ID inPHP Code:
$urlprod = $storeUrl . '/images/' . $_POST['products_image'];
The upload connection is where the stop is... the error file is..PHP Code:
//upload the image and get an MediaID
$media = $connection->upload('media/upload', ['media' => $urlprod]);
$parameters = [
'status' => $message,
'media_ids' => $media->media_id_string
];
//send message
$tweet = $connection->post('statuses/update', array('status' => $parameters));
Think I need to start back tracing twitteroauth.php for the issue.. The image patch id https://www-siteURL-/image/product/1234.jpg and it's under the max 5MB'sCode:[21-Sep-2018 21:03:18 America/Los_Angeles] PHP Fatal error: Uncaught InvalidArgumentException: You must supply a readable file in /****************************/includes/modules/twitteroauth/twitteroauth.php:239
Stack trace:
#0 /****************************/includes/modules/twitteroauth/twitteroauth.php(208): TwitterOAuth->uploadMediaNotChunked('media/upload', Array)
#1 /****************************/includes/modules/product/update_product.php(146): TwitterOAuth->upload('media/upload', Array)
#2 /****************************/product.php(61): require('/home/.../...')
#3 {main}
thrown in /****************************/includes/modules/twitteroauth/twitteroauth.php on line 239
Update...
Found that one needs to first upload a media file before adding to a tweet.. the process is different when posting then from URL, this part I was able to create. However, I found issues with twitterOauth, which apparently was a fork version and never updated to match the current master of twitterOauth..
Having to go back and learn twitter API.. was working on creating a developer sandbox to play in. Something to think about for anyone using twitter web app, they are changing locations and access. If you find autotweet stops working, you may need to reapply to keep your web app alive.
Update2.. problem solved..
Switched to CodeBird-PHP for easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library
Requires PHP7.1 or higher.. This so far was the best one, easy to use, well maintained and documented. Twitter can accept the following media types, all of which are supported by Codebird: PNG, JPEG, BMP, WebP, GIF, Animated GIF, Video. Just did a test run with the new code and it works...
Sent in an update.. I did not code in video abilities for auto tweeting or limits on tweet word counts.. I'm assuming you well follow twitter rules.
I used ZC1.5.5f for the update and Codebird takes the code into PHP7.1 or higher... no idea if this well work with anything less.
FYI.. Twitter is upgrading and the old api.twitter well end and the new developer.twitter well be the norm...
If you wont to see what this looks like... @cowboygeek64
Sent in another update...
I ran into issues creating an item, but not activating it until I had more photos... the mod tried to tweet anyway and failed...
bug.. tweeting disabled product.
Having switches hard coded was one of the problems.
Not able to tweet during updates!
This update removes the need to edit code to turn on/off switches. Auto installer adds admin configures for defaults and keys/tokens. Also added the ability during product creation/update to change some of the defaults per item. Also added the ability to tweet during product update or not.. Added switch for small, large or no image.. Gave quick access to tag lines and the ability to see existing keywords or create new ones per-item tweet!!
Basically I wanted more control over tweets per-item without changing defaults all the time or coding on/off switches..
In case you been wondering whats going on with this mod..
New version is in the works, its not been uploaded yet... it is working on a ZC156a PHP7.3 site with the codebird library. The next push well have more control and work both on new and updates. Twitter feed is created by admin creating or editing products. I've not had time to clean and transfer files over to github yet, well try later on today or this week..