Last active
October 10, 2017 19:38
-
-
Save gcaixeta/54014255e03d3996e443 to your computer and use it in GitHub Desktop.
archive all messages at couchsurfing
This file contains 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
https://www.couchsurfing.com/messages?per_page=6000 | |
var data = { '_method' : 'patch', | |
'authenticity_token' : jQuery('meta[name="csrf-token"]').attr('content') | |
} | |
jQuery('.inbox-thread__item').each( | |
function(i,e){ | |
var id = jQuery(e).attr('id') | |
console.log(id); | |
var url = 'https://www.couchsurfing.com/messages/' + id + '/archive'; | |
$.ajax({ | |
type: "POST", | |
url: url, | |
data: data, | |
success: function( data ) { console.log(data);} | |
}); | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment