# substack-importer/1.0.5/js/index.js

Substack Importer, version 1.0.5. 25 lines.

- Page: https://pluginprobe.com/plugins/substack-importer/1.0.5/code/js/index.js
- Raw: https://pluginprobe.com/plugins/substack-importer/1.0.5/raw/js/index.js
- Modified: 2021-05-06T11:23:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/substack-importer/1.0.5/code/js/index.js#L10-L20`.

```javascript
jQuery(document).ready(($) => {

	let process_posts = () => {
		let data = {
			action : 'substack_progress'
		};

		$.post(ajaxurl, data, (response) => {
			let progress = (response.processed / response.total) * 100;
			$('#substack-progress .progress-bar-fill').css('width', progress + '%');
			if(response.status === 'processing') {
				process_posts();
			} else {
				window.location = $('#substack-progress').data('pre-import-url');
			}
		});
	};

	if( $('div#substack-progress').length ) {
		process_posts();
	}

});


```
