Skip to content

Instantly share code, notes, and snippets.

@unex
Created January 11, 2017 04:53
Show Gist options
  • Save unex/691006777c7924ea4be805f62ec7ae61 to your computer and use it in GitHub Desktop.
Save unex/691006777c7924ea4be805f62ec7ae61 to your computer and use it in GitHub Desktop.

Deletes all comments on your Steam profile

$J.post('//steamcommunity.com/comment/Profile/render/' + g_steamID + '/-1/', {'count': Number.POSITIVE_INFINITY, 'sessionid': g_sessionID}).then(function(data) {
	let requests = [],
        comments = $J('<div></div>').append(data.comments_html).find('.commentthread_comment');

	comments.each(function() {
		let comment_id = $J(this).attr('id').replace('comment_', '')
		requests.push($J.post('//steamcommunity.com/comment/Profile/delete/' + g_steamID + '/-1/', {'gidcomment': comment_id, 'sessionid': g_sessionID}))
    });

	Promise.all(requests).then(function() {
		ShowAlertDialog('Comments Deleted', 'All of your comments have been deleted', 'Reload').then(function() {
            window.location.reload();
        })
    })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment