Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.