Created
November 7, 2017 01:42
-
-
Save gunyarakun/4d70876fa1d20d6153967f8d6b3b3aca to your computer and use it in GitHub Desktop.
wordpress crawler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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