pauamma: Cartooney crab holding drink (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev_training2011-09-21 12:11 pm
Entry tags:

Jumping in with questions and answers

I just came across To Answer, Or Not To Answer. The gist of it is: someone asked "Should I answer a perl question when I'm not sure of the answer or when I can only answer part of the question?" and got overwhelming "yes" answers (and very good suggestions on how to handle uncertainty), because even if your answer doesn't help the person asking, researching your answer (and thinking about the question) may well help you. So as an experiment, I'd like to try something similar in this entry:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in the discussion I linked to above.

If this works, I'll try to make it a regular feature of this community. (How often should it happen?)
allen: (Default)

[personal profile] allen 2011-09-22 04:55 pm (UTC)(link)
Re crossposting to Twitter: what [personal profile] fu said. Use DW::External::Account to store the connection/authentication information, then extend DW::External::XPostProtocol to do the actual implementation. Especially look at overriding XPostProtocol->options() to add in additional, protocol-specific fields (LJXMLRPC does this; look at it for an example).

I have a not-quite-working version of the Atom crossposter that I could upload if you want to see an example of adding a new protocol. That I remember, most of the configuration stuff works; it's just the crosspost itself that doesn't.

I can also give you a walkthrough of how I've done crossposting development in the past (what workers to start, etc.) if you'd like.
skakri: (Default)

[personal profile] skakri 2011-09-22 06:54 pm (UTC)(link)
That would be just great. The API in question uses "User approvement -> hash, hash -> action" model. So I could authorize user, store hash and push post information (title and url) to their API.

Basically, I'd just like to try to dive in, "how stuff works", so far, I've only adjusted DeadJournal plug to xpost to ancient LJ page.

So yes, I'd really like to see the code you're working on. That would help me a lot!
allen: extras (extras)

[personal profile] allen 2011-09-23 04:36 am (UTC)(link)
http://bugs.dwscoalition.org/attachment.cgi?id=5498&action=edit

That should be the attachment itself. Or just go to http://bugs.dwscoalition.org/show_bug.cgi?id=2296 and get it from there.

As I said before, the Atom code doesn't work, but it should work as a template. Oh, and there seems to be a bug that I just noticed where if you go back and view Details on a non-LJXMLRPC account, you still see the LJXMLRPC options.

So the way I usually work on crossposter issues is to open up three windows, go to $LJHOME/bin/worker, and start up xpost, esn-process-sub, and process-esn. Oh, and go into Manage Account, and under Notifications, enable notifications on successful crosspost attempts. Makes troubleshooting easier.

In general, any time you update any crossposter code in DW/External you'll need to restart the xpost worker. You shouldn't need to restart the esn workers unless you're actually working on the notification code.

Some errors that aren't caught by the xpost worker end up in the sch_error table; if you are having mysterious failures, it's worth checking there.

I think that's most of the special crossposter development notes, other than just "here's the code, look at how external accounts are created and configured in externalaccount.bml, look at DW/Worker/XPostWorker to see how the actual crossposting code is called by The Schwartz, and hope that you don't have to deal with the part in between where you actually do the post and the crosspost job gets created." :)
allen: (Default)

[personal profile] allen 2011-09-23 03:19 pm (UTC)(link)
Why both esn-process-sub and process-esn?

Habit? :)
jeshyr: Blessed are the broken. Harry Potter. (Default)

[personal profile] jeshyr 2011-10-01 10:22 am (UTC)(link)
How do you start individual bits like that anyway?I 've only got as far as "worker-manager --debug"