Skip to content

Instantly share code, notes, and snippets.

@gunyarakun
Created November 7, 2017 01:42
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 gunyarakun/4d70876fa1d20d6153967f8d6b3b3aca to your computer and use it in GitHub Desktop.
Save gunyarakun/4d70876fa1d20d6153967f8d6b3b3aca to your computer and use it in GitHub Desktop.
wordpress crawler
# encoding: utf-8
require 'rubypress'
BLOG_ID = 1234
wp = Rubypress::Client.new(
:host => 'xxxxx.wordpress.com',
:username => 'username',
:password => 'password',
:use_ssl => true
)
require 'pp'
a = wp.getPosts(
blog_id: BLOG_ID,
filter: {
:post_type => 'post',
:post_status => 'draft, future, pending, private',
:offset => 0,
:number => 100
}
# fields: ['post_id']
)
pp a
puts wp.connection.http_last_response.read_body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment