Created
September 9, 2008 14:00
-
-
Save mlangenberg/9679 to your computer and use it in GitHub Desktop.
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
# locatie: /app/views/wordpress/page_view.rb | |
class PageView | |
def initialize(page) | |
@page = page | |
end | |
def get_page | |
XMLRPC::Marshal.dump_response( | |
{ | |
:page_id => @page.id, | |
:title => @page.title, | |
:description => @page.description, | |
:link => "/pages/#{@page.id}", #url(:page, @page), | |
:wp_page_parent_id => @page.parent_id, | |
:wp_page_order => @page.page_order, | |
:wp_page_parent_title => @page.parent.title | |
}) | |
end | |
end |
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
# locatie: /app/controllers/wordpress.rb | |
class Wordpress < Application | |
only_provides :xml | |
def get_page | |
current_site.authenticate(params[:username], params[:password]) | |
@page = current_site.find_page(params[:page_id]) | |
PageView.new(@page).get_page | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment