Skip to content

Instantly share code, notes, and snippets.

@LayneSmith
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save LayneSmith/e7557a2f5d30905acf6e to your computer and use it in GitHub Desktop.

Select an option

Save LayneSmith/e7557a2f5d30905acf6e to your computer and use it in GitHub Desktop.
Changing sharing data
//REASSIGN VARIABLES
storyTitle = "New title, can also be a variable with no quotes.";
storyURL = "http://res.dallasnews.com/graphics/2015_03/index.html"; //Can also be a variable
storyImG = "http://res.dallasnews.com/graphics/2015_03/customPreview.jpg"; //Can also be a variable
leadText = "A custom description based on whatever you can script", //Can also be a variable
//ATTACH THEM TO THE APPROPRIATE PROPERTIES
$("meta[property='og\\:title']").attr("content", storyTitle);
$("meta[property='og\\:url']").attr("content", storyURL);
$("meta[property='og\\:image']").attr("content", storyImg);
$("meta[property='og\\:description']").attr("content", storyImg);
//FIRE THE FUNCTIONS AGAIN
shareInit(storyURL, storyTitle, leadText, storyIMG, 'share-bar1');
shareInit(storyURL, storyTitle, leadText, storyIMG, 'share-bar2');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment