aspose file tools*
The moose likes I/O and Streams and the fly likes Posting comments on WordPress blog via Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Posting comments on WordPress blog via Java" Watch "Posting comments on WordPress blog via Java" New topic
Author

Posting comments on WordPress blog via Java

Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

I am working on a module that allows a user to post comments on a WordPress blog. The code for the same can be seen here.

Problem: This blog has Akismet plug-in activated which filters my comment as Spam. I need a way to circumvent this. Is there a setting that I can try (on either side of channel; I am also the blog owner) that can help circumvent this filtering? For e.g. is there a way(using HTTP headers etc.) that my client can identify with the back end so that it is considered authentic?

Please help. Thanks.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

As gathered from web, the filtering is done by Akismet if the posted comment contains hyperlinks - a "valid" comment is most likely to pass through; even though my comment contains plain text, it is getting filtered as spam.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

The post you link to says the code doesn't work. Why are you surprised that it doesn't work?
I've had better luck with Apache HttpClient than the Java API's HTTP functionality.
And yes, the site is probably checking for a valid user-agent in addition to forcing a redirect to throw off spammers.


[How To Ask Questions On JavaRanch]
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

Joe Ess wrote:The post you link to says the code doesn't work. Why are you surprised that it doesn't work?
I've had better luck with Apache HttpClient than the Java API's HTTP functionality.
And yes, the site is probably checking for a valid user-agent in addition to forcing a redirect to throw off spammers.


1. The OP in the linked post(Samuh) is me and that code works when I disable the Akismet plugin.
2. I am using Apache's HttpClient library.
3. Currently the USER-AGENT value passed is: HttpClient. Maybe I should try setting the user-agent to Mozilla or some other browser?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

Monu Tripathi wrote: Maybe I should try setting the user-agent to Mozilla or some other browser?


That is the first thing I'd try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Posting comments on WordPress blog via Java