How to use `wp_insert_post()` and `get_permalink()` functions?

You can include wp-load.php (in the root WordPress directory). This will give you access to the WordPress functions. Note that you can also load wp-blog-header.php, it loads wp-load.php eventually; wp-load will be lighter weight in the end.