While the idea that you are “developing some scrapping plugin” is sketchy and off-putting, the general question is “How do I fire code using system cron jobs?” and that is a valid question.
You don’t need to jump through hoops to load WordPress. Set up an AJAX API callback…
function fire_cron_job_wpse_144051() {
// fire your code
die();
}
// add_action('wp_ajax_fire_cron', 'fire_cron_job_wpse_14405');
add_action('wp_ajax_nopriv_fire_cron', 'fire_cron_job_wpse_14405');
… and have your system cron job make a request to //example.com/wp-admin/admin-ajax.php?action=fire_cron. Note that fire_cron is the trailing part of the two action hooks. You can set that to whatever you like.
Related Posts:
- How do I log plugin (cron) actions?
- Cron firing my function everytime wp-admin is visited
- How Do I Make WordPress Run an Event Every Day?
- get_posts / WP_Query Memory size of 134217728 bytes exhausted
- Hourly WP schedule, do I need at least 1 visitor hourly?
- Scheduled event does not run at midnight
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- WordPress cron running twice
- Will cron job run if page loaded is being served from cache?
- Loading WordPress Admin Environment
- How to schedule a cron job in plugin without waiting for page load request?
- Problems with cron
- How to Trigger WP CRON at Local Timestamp?
- Plugin with functions inside a class & how to trigger WP CRON
- WP Cron as Fast as WordPress AJAX?
- Best place to keep files that are called by cron jobs?
- What is the use of wp_schedule_event hook?
- Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
- Get a path to a different plugin
- How to post data to same page in wordpress
- Change default admin page for specific role(s)
- Check for dependent plugin and if false dont activate plugin
- How to check username/password without signing in the user
- Show message on wordpress admin dashboard
- How to edit the properties of a page programmatically?
- Log in from one wordpress website to another wordpress website
- What’s the earliest point I can get the queried object ID?
- Show a user their recently viewed posts
- How is the data stored in the database?
- How to prevent loading of all plugin’s resources?
- Unit Testing a Plugin functionality with cron
- Plugin development, hooks, generate content
- Add a reset button to the options page (using Settings API)?
- Mediaelement.js feature doesn’t work
- Is it possible for a plugin to register a page template file?
- How to alter the order of custom form fields
- Help with callback using do_action_ref_array
- How to extend a plugin like we do a theme?
- How to add custom text in wordpress logs
- Rewrite url for existing page without flush_rewrite_rules
- Front-End Interfaces Without Shortcodes
- Is there a way to loop through a shortcode datasource to create a table?
- Execute plugin for specific user role(s) only
- How can I render shortcode so that its not cached by Caching plugins?
- WordPress REST API, run long background job
- Make a list with header and subtext in Gutenberg blocks
- Does WordPress support WebP images?
- How plugins_loaded works?
- Enqueue scripts in footer
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- the_editor() function
- Including the necessary functions for a custom ajax registration form
- Why doesn’t my simple the_title filter get applied?
- WordPress clean internationalization for menus?
- JSX in WordPress Plugin Development
- W3 Total Cache JS and css Minify folder are empty
- Force HTTPS 301 redirect with hook
- Filter Categories widget to allow custom sorting?
- Make a plugin page out of influence of the theme’s style
- plugin_dir_path wrong url
- 400 Bad Request, in wordpress theme development, wp_ajax
- How to allow only two (or more) users access to a plugin
- Return Value of load_plugin_textdomain
- Special Formatting for WordPress Plugin Description?
- Multiple array for post_content on plugin activation
- Check if the current user is author of first comment
- custom wp_editor does not save the content in plugin settings
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Add code to template dynamically
- How Can I Add Code To A Preexisting Function Without Editing it
- Creating posts with links from a txt file
- Change the behaviour of a button
- Login page too many redirects
- Configuring Xdebug with docker compose
- escape html in jQuery for WordPress
- Progress bar in plugin within admin
- Jquery php request is returning a weird result
- WordPress admin panel not working
- Redirection from a specific page for users logged in but not with membership
- Load script on frontend from widget plugin
- Can’t get wpColorPicker to work in a widget
- Get the current post/page URL with plain permalinks
- ajax multiple Values
- WordPress Plugin Update Process
- Ajax functionality not being called under wordpress plugin
- Registration form Plugin… Email confirmation
- Add a description/hint field in the admin page of a plugin
- Saving multiple fields as array
- Serialized Data
- Can’t add images in wordpress to my page – button isn’t clickable
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- I don’t understand how symlinks in plugin work
- Undo operation not working in Rich text [Gutenberg]
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Calling get_header() with installed FSE theme
- Reinitiate Gutenburg’s blocks using javascript
- Generating Multiple Divi Pages from Database
- Is there a hook for updated image metadata upon using image editor?