?
Solved

Share on Social Network

Posted on 2014-03-27
8
Medium Priority
?
550 Views
Last Modified: 2014-03-28
Hello,

I need to place three icons (FB, Twitter and G+) on a page so the user can share a webpage.

I was able to do it at Twitter, which looks like the simplest one, but I need to do the same at google+ and FB.

The trick is I need to share a URL different than the current one, and add a text. This is because different agents will use this feature.

So for example, if the site is www.mywebsite.com I need to share a short URL as 584.tinyurl.com... but the share button will be placed at www.mywebsite.com

The text to be shared will be something like "Learn how to save up to 40% on your life insurance policy, click here: http://123.url.com"

We did this o twitter, but cant find a way to do it on FB or G+

Any ideas?
0
Comment
Question by:SimpleDude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39961240
Try using sharethis https://www.sharethis.com/  it will do a lot of the work for you and even show you some analytics and they have the icons in different formats.
0
 

Author Comment

by:SimpleDude
ID: 39961440
I cant, that's ad driven. This is for a customer.

Thanks anyway... weird I didnt get more answer, when I was an EE member yers ago I used to get tons of answers. Is experts exchange  dying?
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39961483
I think that depends on the subject.  

I have not done what you are trying to do by using a different url.   It does look like you can use <link rel="canonical" ... /> and g+ will take that as the link for the page instead of the canonical URL.  https://developers.google.com/+/web/share/
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39961490
Facebook... https://developers.facebook.com/docs/plugins/share-button/

Just fill in the url you want and it will generate the code.

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=123abc";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-share-button" data-href="http://123.url.com" data-type="button"></div>

Open in new window

0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39961495
On an side note, there are some changes in the near future.  

http://offers.experts-exchange.com/ExpertsExchange2014ProductRoadmapWebinar.html
0
 

Author Comment

by:SimpleDude
ID: 39961789
Thanks for the reply.

I guess what I am looking to do is something similar of what EE has at the left of this screen (FB Share), where I can control the title and content of the sharing. Maybe on a new Popup as they do here?
0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39961843
The code I gave you will do just that.  http:#a39961490  You can take it for a test spin if you like http://jsbin.com/pizuzepo/1/edit?html,output

You will need to change this part either statically or dynamically
<div class="fb-share-button" data-href="http://123.url.com" data-type="button"></div>

Open in new window


I would keep the href to the actual link, but use js to communicate with your url shortner and generate the short url on the fly via ajax.
0
 

Author Closing Comment

by:SimpleDude
ID: 39962046
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
There is a massive demand for content on the web right now, and it doesn't look like it's going to stop any time soon. But, if you are running a business blog, it's not just enough to offer your audience lots of content. It needs to be high-quality…
The goal of the tutorial is to teach the user how to instant message and make a video call in Skype.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question