Last active
August 29, 2015 14:18
-
-
Save LayneSmith/e7557a2f5d30905acf6e to your computer and use it in GitHub Desktop.
Changing sharing data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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