WebFaction
Community site: login faq

is there support for calling webfaction API in Ruby?

this did not work:

require 'xmlrpc/client'
conn = XMLRPC::Client.new 'https://api.webfaction.com/'
session_id, account = conn.call 'login', 'widgetsco', 'widgetsrock'
# -> SocketError: getaddrinfo: Name or service not known

asked 26 Apr '13, 13:08

akonsu
64714
accept rate: 100%

edited 26 Apr '13, 13:23


The problem is that you're using a URI with the new method. new takes a hostname, not a URI, so it's trying to resolve 'https://api.webfaction.com/' as a host name.

I recommend that you use new2 instead, eg:

#!/usr/bin/env ruby
require 'xmlrpc/client'
conn = XMLRPC::Client.new2 'https://api.webfaction.com/'
session_id, account = server.call 'login', username, password

Please see the Ruby XMLRPC::Client documentation for more info.

Hope that helps!

permanent link

answered 26 Apr '13, 16:15

seanf
12.2k42136
accept rate: 37%

edited 26 Apr '13, 16:18

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×82
×76

question asked: 26 Apr '13, 13:08

question was seen: 3,193 times

last updated: 26 Apr '13, 16:18

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM