Skip to content

Instantly share code, notes, and snippets.

@beppe9000
Created March 22, 2017 01:02
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 beppe9000/4cebca16897646588004527c17cdf020 to your computer and use it in GitHub Desktop.
Save beppe9000/4cebca16897646588004527c17cdf020 to your computer and use it in GitHub Desktop.
My Anime List Quick Addd Button & Other Things - WIP
/*
* Questo è un blocco per gli appunti JavaScript.
*
*Inserire del codice JavaScript, fare clic con il tasto destro o selezionare dal menu Esecuzione:
* 1. Esegui per eseguire il codice selezionato (Ctrl+R)
* 2. Analizza per aprire una finestra di analisi oggetto sul risultato (Ctrl+I)
* 3. Visualizza per inserire il risultato come un commento dopo il testo selezionato. (Ctrl+L)
*/
//document.baseURI
//https://myanimelist.net/forum/?topicid=49347
var obb = new Object;
obb.durl = document.baseURI;
obb.addurl = 'https://myanimelist.net/ownlist/anime/add.json';
obb.editurl = 'https://myanimelist.net/ownlist/anime/edit.json';
obb.tkn = $('meta[name=csrf_token]').attr('content');
obb.baseData = {
'anime_id': 0,
'status': 6,
'score': 0,
'num_watched_episodes': 0,
'csrf_token': obb.tkn
}
obb.baseData.anime_id = 0;
obb.new_id = $('#myinfo_anime_id').attr('value');
obb.baseData.anime_id = obb.new_id;
var jqxhr = $.post('example.php', function () {
alert('success');
}).always(function () {
alert('finished');
});
obb.req1 = $.ajax({
url: 'https://myanimelist.net/ownlist/anime/add.json',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
'anime_id': 153,
'status': 6,
'score': 0,
'num_watched_episodes': 0,
}),
dataType: 'json',
contentType:"application/x-www-form-urlencoded; charset=UTF-8"
});
obb.req2 = $.ajax({
url: 'https://myanimelist.net/ownlist/anime/edit.json',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
'anime_id': 153,
'status': 6,
'score': 0,
'num_watched_episodes': 0,
}),
dataType: 'json',
contentType:"application/x-www-form-urlencoded; charset=UTF-8"
});
obb;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment