Skip to content

Instantly share code, notes, and snippets.

@OmgImAlexis
Created December 3, 2017 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OmgImAlexis/2ffeaf308cee508105849f08a91e7a17 to your computer and use it in GitHub Desktop.
Save OmgImAlexis/2ffeaf308cee508105849f08a91e7a17 to your computer and use it in GitHub Desktop.
var post_ids = Object.keys(archive_posts);
var postsToSend = [];
var hostname = window.location.hostname;
if (jQuery("#postEditData").val().trim() != "") {
var edit = jQuery("#postEditData").val();
}
for (var i = 0; i < post_ids.length; i++) {
var p = {
"id": post_ids[i],
"hostname": archive_posts[post_ids[i]].hostname + ".tumblr.com",
"key": archive_posts[post_ids[i]].key,
"clear": false,
"caption": edit,
"tags": $("#tagData").val()
};
postsToSend.push(p);
}
[
'jockorgy'
].forEach(function(url){
$.post('https://qplus.io/svc/addPosts', {
hostname: url + ".tumblr.com",
posts: postsToSend
}, function (data) {
if(data == 'ok'){
console.log(url + ".tumblr.com" + ' sent to Qplus!')
} else {
console.log('Error with ' + url + ".tumblr.com")
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment