1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.feedparser.post;
18
19 import java.util.Hashtable;
20 import java.util.Vector;
21
22 import org.apache.xmlrpc.XmlRpcClient;
23
24
25
26
27
28
29
30 public class MetaWeblogPostAgent {
31
32 public void newPost( String router,
33 String weblog,
34 String username,
35 String password,
36 PostEntry entry ) throws Exception {
37
38 XmlRpcClient xmlrpc = new XmlRpcClient( router );
39
40 Vector params = new Vector();
41 params.add( weblog);
42 params.add( username );
43 params.add( password );
44
45 Hashtable struct = new Hashtable();
46
47 struct.put( "title", entry.title );
48 struct.put( "description", entry.description );
49
50 params.add( struct );
51 params.add( new Boolean( true ) );
52
53 Vector v = (Vector)xmlrpc.execute( "metaWeblog.newPost", params );
54
55 }
56 }
57