Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function()
- {
- jQuery.ajax({
- type: 'GET',
- url: '//api.steampowered.com/ISteamApps/GetAppList/v2',
- dataType: 'jsonp',
- success: function(result) {
- var wishlist = [];
- jQuery.each(result['applist']['apps'], function(key, value){
- wishlist.push( value['appid'] );
- });
- var i = 0,
- loaded = 0,
- total = wishlist.length,
- modal = ShowBlockingWaitDialog( 'Removing...',
- 'Please wait until all requests finish.' );
- var ExecuteRequest = function( )
- {
- jQuery.ajax(
- {
- type: 'POST',
- dataType: 'text',
- url: '//store.steampowered.com/api/removefromwishlist',
- data:
- {
- appid: wishlist[ i ],
- sessionid: g_sessionID,
- }
- }
- ).always( function( )
- {
- loaded++;
- modal.Dismiss();
- if( loaded >= total )
- {
- ShowAlertDialog( 'All done!', 'Enjoy.' );
- }
- else
- {
- modal = ShowBlockingWaitDialog( 'Removing...',
- 'Loaded ' + loaded + '/' + total + '. Ignore all the errors, let it finish.' );
- i++;
- ExecuteRequest();
- }
- }
- );
- };
- setTimeout( ExecuteRequest, 1500 );
- },
- error : function(httpReq,status,exception){
- ShowAlertDialog( status, 'An Error has Occured! Please refresh the page and re-execute this script' );
- },
- jsonp: 'jsonp'
- });
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement