Customize URL in AddThis - addthis

How can i access the URL generated in addthis and append a query string before it gets emailed to other persons?
Thanks

From their site:
To define the URL to share you do it in one of four ways. For our
newest tools, use the data-url and data-title parameters, like this:
<div class="addthis_sharing_toolbox"
data-url="THE URL"
data-title="THE TITLE">
</div>
If the code you're using has the addthis_toolbox in it, use the
addthis:url and addthis:title parameters, like this:
<div class="addthis_toolbox addthis_default_style "
addthis:url="THE URL"
addthis:title="THE TITLE">
or you can set it using the addthis_share variable, which will change
the URL and title shared for all the AddThis tools on the page:
<script type="text/javascript">
var addthis_share = {
url: "THE URL"
title: "THE TITLE"
}
</script>
In any case, be sure to replace THE URL and THE TITLE with the URL and
title of the pages to share.

Related

How to update/replace Facebook Embedded posts in html?

I want to be able to update/replace embedded facebook posts in my website.
For example say i have this code (part of the codesnippet is taken from facebook here):
<html>
<title>My Website</title>
<body>
<button onclick="replacePost();">replace</button>
<script src="//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.2"async></script>
<div id="myDiv">
<div class="fb-post"
data-href="https://www.facebook.com/FacebookDevelopers/posts/1234"
data-width="500"></div>
</div>
<script>
function replacePost()
{
var newHTML = '<div class="fb-post"';
newHTML += 'data-href="https://www.facebook.com/FacebookDevelopers/posts/123"';
newHTML += 'data-width="500"></div>';
$("#myDiv").html(newHTML);
}
</script>
</body>
</html>
Here as an example, when the page loads, there is a button and then the facebook post with the id 123 will pop up as expected. And when i click the button, i use jQuery to find the parent div of the facebookpost, and replace it with some new HTML. In this case, a post with the id 1234. But the post will not pop up :-( (Hopefully, you can see what i am trying to do).
So how do i dynamically delete a post and replace it with another post?
You need to parse your html again so that the facebook sdk can fetch the new post. If you change your JavaScript to the following:
<script>
function replacePost()
{
var newHTML = '<div class="fb-post" data-href="https://www.facebook.com/20531316728/posts/10154009990506729/"data-width="500">';
$("#myDiv").html(newHTML);
FB.XFBML.parse() //<---- add this
}
</script>
Then each time you call replacePost you html will be parsed again. Instead of parsing the whole page you can parse a specific tag for the sake of efficiency:
FB.XFBML.parse(document.getElementById('foo'));
Docs here: https://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse

Customizing Addthis Plugin - passing url using classic asp

I am having lots of problems while coming up with a solution.
I have a website that share text or image greetings( text greeting only at this time) on facebook or twitter etc. I planed to use Addthis.
So I created a function like this
<%
Function DisplayShareDiv(surl, sT, sSummary)
%>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
addthis:url="<%=surl%>"
addthis:title="<%=sT %>"
id="addthis_container"
addthis:Description="<%=sSummary%>">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_google_plusone"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = { "data_track_addressbar": true };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=###################3"></script>
<!-- AddThis Button END -->
<%
end function
%>
Now problem is that title appears when click on facebook or twitter but url doesn't. I also want to add the description to it. I have og tags too but they need to be dynamic too and i am having problems with fb not picking up that info either. Even though i have run it through debugger. I am at it for 2 days and it is now all a mish mash. I would really appreciate if someone can please help me!!
Now I'm getting this. Is that as you require?
I think facebook was picking up an old version of your page.
The text it picked up were from the OG and description meta tags on your home page.
If you run your page through their debugging tool, that forces it to scrape the latest version of your page. Plus you might get some useful info too. https://developers.facebook.com/tools/debug/

addthis share vs custom share button

i need to add to my website a share-feature.
this php page should allow users to share my webiste on the social network, but i need to set a custom url, title, description and image.
i have try with addthis share buttons, but i m not sure that is possibile to fully customize the buttons... right?
there are other services like that? or in my case is better to add share button with facebook api, twitter api,..?
this is the addthis share code:
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xx"></script>
You can set a custom title, url and description by specifying addthis:title, addthis:url and addthis:description tags in you toolbox HTML like this:
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
addthis:url="http://example.com"
addthis:title="An Example Title"
addthis:description="An Example Description">
However, Facebook and some other services don't respect the values sent to them and scrape your page for og:title, og:url and og:description tags. So to be safe, specify the above in your AddThis code and also specify the same values for your og tags. You can read more about the og tags here:
http://www.addthis.com/blog/2012/09/27/debugging-sharing-to-facebook
You could try this: You could try this: http://sharebuttongenerator.aakilfernandes.com/

how add redirect to oscommerce product page

I have an oscommerce shopping cart site and I'm trying to set up an automatic redirect with 30-second time-delay from one product page to another product page, and include a message like "this prod. is now replaced by [new catalogue number]. You will be automatically redirected." How do I get into the raw HTML/PHP coding for each product so I can put a redirect meta-tag or javascript coding in? Note: I only want to set up the redirect for a handful of product pages (not all products currently on the site).
<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
window.location = "productpage.php"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect, please update your bookmarks to our new
location!</p>
</body>
</html>​
you can use Js redirect look like above
check from here > http://jsfiddle.net/JnUVF/

Social media share buttons don't redirect back to fan page iframe product page

A friend of mine added a store to my fan page that uses the iframe...basically putting a website inside a facebook frame. It has a SSL certificate. We added social media like buttons to each product page by using addthis.com code. See below. The code below works on the product page, however the problem is when you share it to facebook or google+, the link that is provided for that product, when clicked, takes the user to the hosting url where the zencart resides.
<link rel="image_src" href="<?php echo "http://" . $_SERVER['HTTP_HOST'] . "zencart1/images/" . $products_image; ?>" />
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" glusone:size="medium"></a>
<a class="addthis_button_pinterest_pinit"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; </script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-501a85992fdcfe86"></script>
<!-- AddThis Button END -->
Fan Page: https://www.facebook.com/TracyLoganDesigns
Go to the category Scarves - this is where I have a test product.
When you click on the product test link once it's been shared on facebook, etc, this is the link it goes to: http://firetreegraphics.com/zencart1...9#.UBrFH01lTjY
How can I set it up so that it will go back to the fan page url?
How can I set it up so that it will go back to the fan page url?
By not liking/sharing the product page hosted on your server, but the Facebook URL of your /page/app combination.
If you want to link to a specific product page inside of your app on Facebook (and not just the start page), then you have to use the app_data parameter inside of that link, and get it’s from the signed_request parameter once your app is loaded into the iframe on Facebook.