Projecto; Publicar no WordPress via Flex Project; Post in WordPress via Flex


Bem, tenho estado um pouco ausente do blog, mas não por falta de vontade, mas porque além do trabalho tive uma ideia que parecia absolutamente facil, mas que me tirou do sério!! Well, I've been a little absent from the blog, but not for lack of desire, but because of work than I had an idea that seemed quite easy, but I took the seriously!

Como sabem existem muitos programas para publicar artigos no wordpress remotamente como o Live Writer, Flock, Ecto, Elicit ou WB Editor, mas nada se vê em Flex/AIR e então decidi meter mãos à obra e tentar fazer um cliente para escrever no wordpress, que segundo algumas especificaçoes sobre o XML-RPC seria bem facil de fazer… As you know there are many programs to publish articles in wordpress remotely like Live Writer, Flock, Ecto, Elicit or WB Editor, but nothing can be seen in Flex / AIR and then decided to get to work and try to do a client to write in wordpress, which according to specifications on the XML-RPC would be quite easy to do ...

Ora, “Bem facil” é tudo menos facil, inicialmente usei uma biblioteca do php “xmlrpc”.inc que apesar de alguns problemas lá consegui colocar a funcionar, mas dependia sempre de um servidor que suportasse php e isso não era interessante. But "quite easy" is anything but easy, initially used a library of php "XmlRpc." Inc that despite some problems there could get to work, but always depended on a server that supports PHP and it was not interesting. Depois de alguns minutos de investigação descobri 2 bibliotecas XML-RPC para o Action Script 3 que foram evoluidas do AS2. After a few minutes of research I discovered 2 XML-RPC libraries for the Action Script 3 that were developed as AS2.
Veja o exemplo online mais a baixo… Here's an example more online at low ...


O maior problema disto tudo foi mesmo perceber os dados ea forma como eles eram enviados e recebidos o wordpress… e acreditem, não é nada facil… para verem o grau, tentem dar uma vista de olhos no ficheiro xmlrpc.php que está na directoria do vosso wordpress, este é a interface para chamadas XML-RPC (Remote Procedure Call) que usa XML para comunicar com esta interface. The biggest problem of all this was even understand the data and how they were sent and received the wordpress ... and believe it is not easy ... to see the degree, try to take a look at the xmlrpc.php file that is in the directory your wordpress, this is the interface for calls XML-Remote Procedure Call (RPC) that uses XML to communicate with this interface. O ficheiro em si já é bastante elaborado, e como de esperar usa o “core” do php o que necessita de bastantes conhecimentos para desvendar o seu funcionamento. The file itself is quite developed, and how to wait uses the "core" of php you need a lot of knowledge to unveil its operation. E por incrivel que pareça o codex do worpress.org pouco ou nada ajudou. And by the Codex seems incredible that the worpress.org little or nothing helped.

Depois de quase 8h lá consegui o básico, ler as categorias do blog, e escrever um post usando flex e publicando no wordpress nas devidas categorias. After almost then it 8hr the basics, read the blog categories, and write a post using flex and publishing in wordpress under appropriate categories.

Outro dos grandes problemas ainda é o RichTextEditor que com o seu html miserável simplesmente enviada o conteudo do post para o wordpress e este era apresentado com um tamanho e formatações ilegiveis. Another major problem is still the RichTextEditor that your html miserable simply sent the contents of the post for wordpress and this was presented with an illegible size and formatting. Lá tive que usar um filtro para eleminar e substituir alguma da formatação do texto html do richTextEditor. There had to use a filter to replace any disqualified and the text formatting of RichTextEditor html.

O projecto têm algumas limitações, como a falta de envio de fotografias (limitação do flash) visto que as fotografias têm que ser enviadas encriptadas em base64 eo flex não deixa abrir um fotografia local na runtime. The project has some limitations such as lack of transmission of photos (limitation of flash) since the photos have to be sent encrypted base64 and flex it open a photo in the local runtime. (pode ser resolvido na versão AIR ou no Flash 10 Flex 4) Alem disto tudo, os links como uma imagem: <img src=…> não funciona porque o parser XML do wordpress não a transforma em imagem, mas sim texto… mais um ponto a resolver. (may be resolved in the version in Flash or AIR 10 Flex 4) Besides all the links as an image: <img src=…> does not work because the XML parser of wordpress not transformed into the image, but more text ... a point to be resolved.

O projecto foi elaborado com 2 bibliotecas XML-RPC para o Action Script 3, visto que ambas continham alguns problemas na obtenção de determinados dados, por isso usei as duas por uma questão de manter o código intacto. The project was developed with 2 XML-RPC libraries for the Action Script 3, since both had some problems in obtaining certain information, so I used both as a matter of keeping the code intact. Depois de criar duas class’s para lidar com o código e funções o resultado final pode ser corrido em qualquer browser ou aplicação AIR (brevemente). After you create two class's code to handle the functions and the end result can be run on any browser or application AIR (soon).

Veja a aplicação online Check out the online application

Podem fazer o download do swf aqui e correr no vosso ambiente de trabalho, mas para funcionar em qualquer outro blog necessário um ficheiro crossdomain, que deve ser colocado na raiz do vosso blog, podem fazer o download do crossdomain.xml (.rar) para a raiz do vosso blog They can download the swf here and run on your desktop, but to run on any blog crossdomain needed a file, which must be placed at the root of your blog, they can download the crossdomain.xml (. Rar) to the root of your blog

O código fonte ainda não está disponivel, se alguém estiver interessado em participar no projecto envie um email. The source code is not yet available, if someone is interested in participating in the project send an email.

ps devem efectuar o login primeiro no vosso blog. ps should make the first login on your blog. (usando o endereço do blog sem a / no final, como no exemplo.) Se quiserem testar e não confiarem em mim, criem um utilizador temporario no vosso blog com uma pass temporaria, e assim não correm riscos de pensarem que vos posso roubar a password… =D (using the address of your blog without a / in the end, as in the example.) If you want to try and not rely on me, create a temporary user in your blog with a temporary pass, and therefore not at risk of thinking that you can steal the password = D ...

ps2. Este mesmo post foi escrito atravéz da aplicação Flex exceptuando a imagem que foi colocada posteriormente. This same post was written through Flex application except that the image was posted later.

versão pdf temporariamente indisponivel. pdf version temporarily unavailable.
Deixe um comentário or Deixe um Trackback Leave a comment or Leave a Trackback

Deixe um comentário Leave a comment

O seu email nunca será publicado ou partilhado. Your email is never published or shared. Campos obrigatórios estão marcados com um * Required fields are marked with an *

*
*




"));