top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Posting to WordPress from a Perl script?

0 votes
713 views

Do you know if there is a working module that can be used to post to WordPress from a Perl script? I've seen that all the modules that contain WordPress are very old.

I need to install that module under a Perl built with Perlbrew. I tried to install WordPress, WordPress::API, but they both depend on WordPress::XMLRPC which depends on SOAP::Lite which depends on XML::Parser which can't be installed because of the error "expat.h - no such file or directory".
I also tried to install XML::Parser::Expat but it gives the same error.

By curiosity I searched for a Python module, and I found python-wordpress-xmlrpc, I installed it very fast and easy, I found that it offers more features than the Perl module WordPress, I tested a sample script I found on the web, and it worked very well.

posted Jul 19, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

If you can figure out the exact parameters that Wordpress normally posts you can replicate those same parameters + cookie session information and it should work.
Another nice alternative would be to look at the Mechanize CPAN modules. Using Mechanize you can in perl code browse a web page, click links, fill out forms and submit.

answer Jul 19, 2013 by anonymous
Also, to fix the expat error you need to install libxml development libraries, depending on your distro this can be accomplished in different ways.
Similar Questions
0 votes

How can write a python script which will execute some perl scripts in a gui and shouldn't be post processed....?

+1 vote

I have a perl script test.pl. I want to create desktop shortcut. While I click on this shortcut icon it will run my perl script and keep the terminal open.

I have tried the command

ln -s test.pl ~/Desktop/abc

while I click on this abc Icon from my desktop. It run and same time the terminal exit. Could you please help here?

My requirement is:

I want to create desktop shortcut for particular perl program. While I click on this icon from desktop, it should run and keep the terminal open.

+2 votes

Is there any Bugzilla API to upload and download bug's attachment files with perl script?
I want to write a Perl script to download all the attachment in a specified bug, and save the files to local directory.
Attachment method in Bugzilla::Webservice::Bug seems not to download or upload attachment from or to bug.

+1 vote

I have a 3rd party perl script:

 head -n 1 /usr/sbin/ftpasswd
#!/usr/bin/perl

I want to write data to stdin and read from stdout:

proc = Popen( ["/usr/bin/perl", "/usr/sbin/ftpasswd" "--hash", "--stdin"], 
stdout=PIPE, stdin=PIPE)

output, input = proc.communicate(pwd)
return output.strip()

Since pwd comes from a non-trusted source I don't want to use shell=True.
The arguments to the perl interpreter do not seem to right:

Can't open perl script "/usr/sbin/ftpasswd--hash": No such file or directory

Adding a leading " " to "--hash" does not help. How can I use that script and achieve something like

# echo "123" | ftpasswd --hash --stdin
ftpasswd: $1$8BuLAqCl$y/URBN/OCSLsKtnu8nFHH0
...