fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] dw_dev_training 2011-09-22 02:45 am (UTC)

The main thing you need to do to implement crossposting is to create another subclass of cgi-bin/DW/External/XPostProtocol.pm. You can get the list of methods that the subclass needs to implement from that file as well; it's in the section called

# instance methods for subclasses.


We currently only have one for LJ-based sites -- cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm, you can use that to see what (in general) you need to handle in each.



Then, so that it will be registered as a crosspost handler, and show up in the dropdown when you're setting up a crosspost account, add the class to the protocols hash in cgi-bin/DW/External/XPostProtocol.pm, like it is here:


my %protocols;
eval { $protocols{"lj"} = DW::External::XPostProtocol::LJXMLRPC->new; };



I'd probably start really simple first! Hardcode authentication while you figure out how to use the other site's protocol, and then when that's working, figure out the problem of storing the authentication.


Why not continue to use the externalaccount table, btw? The field says password, but it's always just the hashed password which can be used as an authentication token; it's not a huge stretch to use it for other auth schemes.

Post a comment in response:

From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.