Javapress - An API to connect wordpress through java. No need of XMLRPC or other libraries.
What's up everyone! I have created a small light weight API that you can use in your Java code to connect to your wordpress website/blog. It is in initial phases and does the basic functions. Hope it helps!
To download click here: https://drive.google.com/file/d/0BziaxOG6e3ODTEw2NjFSVzZveXc/view?usp=sharing
GitHub Repo: https://github.com/siddhantminocha/javapress
How to use:
It's a very easy to use API. 1) Download the zip.
2) There are two folder: lib and php. Upload all the php files to your wordpress directory and place all the jars in the "lib" folder in your classpath.
3) There are 8 php files. Open each file one by one.
find the line
if( $password == "newpassword"){
and change "newpassword" with a password of your choice in all the files. Don't forget the quotes. For eg. if you want to change the password to SiddhantMinocha, you will change the line like:
if( $password == "SiddhantMinocha"){
Do this in all the 8 files. Use the same password in all files.
4)After you are done with php files, its time to move on to the java codes.
5) First, add the jars to your classpath.
6) Read the self explanatory code.
import javapress.*;
public class NewMain {
public static void main(String[] args) {
javapress myblog = new javapress();
myblog.wordpress = "http://localhost/wordpress"; //your website location
myblog.password = "newpassword"; //the password you have set in all php files.
myblog.CreateNewPost("A new post", "This is the content of the newest post", 11); //Pass variables in the method
}
}
Supported methods are:
CreateNewPost();
createCategory("categoryName");
createNewUser("username", "email", "password" );
deleteCategory(categoryID);
deletePost(postID);
getCategory("categoryName"); //Returns Cat ID
updatePost("postID", "postContent");
getPostType(postID); //returns type of the post in a string.
Lots of love! Happy Coding! :D
To download click here: https://drive.google.com/file/d/0BziaxOG6e3ODTEw2NjFSVzZveXc/view?usp=sharing
GitHub Repo: https://github.com/siddhantminocha/javapress
How to use:
It's a very easy to use API. 1) Download the zip.
2) There are two folder: lib and php. Upload all the php files to your wordpress directory and place all the jars in the "lib" folder in your classpath.
3) There are 8 php files. Open each file one by one.
find the line
if( $password == "newpassword"){
and change "newpassword" with a password of your choice in all the files. Don't forget the quotes. For eg. if you want to change the password to SiddhantMinocha, you will change the line like:
if( $password == "SiddhantMinocha"){
Do this in all the 8 files. Use the same password in all files.
4)After you are done with php files, its time to move on to the java codes.
5) First, add the jars to your classpath.
6) Read the self explanatory code.
import javapress.*;
public class NewMain {
public static void main(String[] args) {
javapress myblog = new javapress();
myblog.wordpress = "http://localhost/wordpress"; //your website location
myblog.password = "newpassword"; //the password you have set in all php files.
myblog.CreateNewPost("A new post", "This is the content of the newest post", 11); //Pass variables in the method
}
}
Supported methods are:
CreateNewPost();
createCategory("categoryName");
createNewUser("username", "email", "password" );
deleteCategory(categoryID);
deletePost(postID);
getCategory("categoryName"); //Returns Cat ID
updatePost("postID", "postContent");
getPostType(postID); //returns type of the post in a string.
Lots of love! Happy Coding! :D
0 comments:
Post a Comment