コード例 #1
0
<?php

//http://mylittlename.wordpress.com/
require_once 'Services/Blogging.php';
$bl = Services_Blogging::factory('Blogger', 'mylittlename', 's3rgq8cqr32', 'http://mylittlename.wordpress.com', '/xmlrpc.php');
$bl->setBlogId('mylittlename');
$post = $bl->createNewPost();
//$post->setId('114750983909350416');
$post->content = "This is a test post by Services_Blogging\r\n\r\nSecond line\r\nThird one";
$bl->savePost($post);
echo 'post id: ' . $post->id;
//echo 'delete ' . $bl->deletePost($post);
//var_dump($bl->deletePost('114752812340833006'));
/*
try {
var_dump($bl->getBlogs());
var_dump($bl->getSupportedTemplates());
var_dump($bl->getTemplate('masin'));
} catch (Exception $e) {
    var_dump('Exception: ' . $e->getMessage());
}
*/
コード例 #2
0
<?php

/*
dummytest@mailinator.com
mylittlename
s3rgq8cqr32
API key: c7eb231e4dfd
*/
//http://mylittlename.wordpress.com/
require_once 'Services/Blogging.php';
//$bl = Services_Blogging::factory('metaWeblog', 'mylittlename', 's3rgq8cqr32', 'http://mylittlename.wordpress.com', '/xmlrpc.php');
$bl = Services_Blogging::factory('metaWeblog', 'mylittlename', 's3rgq8cqr32', 'http://blog.bogo', '/xmlrpc.php');
$post = $bl->createNewPost();
//$post->setId('14');
$post->title = 'Modified post title';
$post->content = "This is a modified test post by Services_Blogging\r\n\r\nSecond line\r\nThird one";
$post->categories = array('cat1', 'cat3');
$bl->savePost($post);
$nLastPostId = $post->id;
echo 'post id: ' . $post->id . "\r\n";
//$bl->deletePost(17);
var_dump($bl->getPost($nLastPostId));
var_dump($bl->getRecentPostTitles(2));
var_dump($bl->getRecentPosts());
コード例 #3
0
ファイル: sb-write.php プロジェクト: haru8/foltia
$blogmessages = "<img src=\"{$wordpressimgdir}/{$imgpathfilename}\" width=\"160\" height=\"120\" alt=\"{$blogtitle}\"> " . $blogmessages;
print "{$copycmd} \n";
//
$oserr = `{$copycmd}`;
print "{$oserr} \n";
//
//書き込み
require_once 'Services/Blogging.php';
//$blogurl = "http://www.dcc-jpl.com/wp3/wordpress/";
//$datafilepath = "/home/jplcom/public_html/soft/map/data";
//$picturepath = "http://www.dcc-jpl.com/wp3/wordpress/wp-content/uploads/";
$settings = Services_Blogging::discoverSettings($blogurl);
$choicedriver = Services_Blogging::getBestAvailableDriver($settings) . "\r\n";
$server = $settings["apis"]["MetaWeblog"]["server"];
$path = $settings["apis"]["MetaWeblog"]["path"];
$bl = Services_Blogging::factory('MetaWeblog', $blogwriteid, $blogwritepw, "{$server}", "{$path}");
print "{$server} \n";
print "{$path} \n";
//print "$blogtitle <br />\n";
//print "$blogmessages <br />\n";
print "--> \n";
$post = $bl->createNewPost();
$post->title = "{$blogtitle}";
$post->content = "{$blogmessages}";
$bl->savePost($post);
//echo 'post id: ' . $post->id;
print "<a href = \"{$blogurl}/?p=";
echo $post->id;
print "\">Go Entry</a><br /><hr>\n";
$blogtitle = mb_convert_encoding($blogtitle, "UTF-8");
print "{$blogtitle} <br />\n";
コード例 #4
0
<?php

//http://mylittlename.blogspot.com/
require_once 'Services/Blogging.php';
$bl = Services_Blogging::factory('Blogger', 'mylittlename', 's3rgq8cqr32', null, null);
$bl->setBlogId('28025532');
$post = $bl->createNewPost();
//$post->setId('114750983909350416');
$post->content = "This is a second modified test post by Services_Blogging\r\n\r\nSecond line\r\nThird one";
$bl->savePost($post);
echo 'post id: ' . $post->id;
//echo 'delete ' . $bl->deletePost($post);
//var_dump($bl->deletePost('114752812340833006'));
/*
try {
var_dump($bl->getBlogs());
var_dump($bl->getSupportedTemplates());
var_dump($bl->getTemplate('masin'));
} catch (Exception $e) {
    var_dump('Exception: ' . $e->getMessage());
}
*/
コード例 #5
0
<?php

//http://mylittlename.livejournal.com/
require_once 'Services/Blogging.php';
$bl = Services_Blogging::factory('LiveJournal', 'mylittlename', 's3rgq8cqr32', null, null);
/*
$post = $bl->createNewPost();
$post->title = 'Testtitle';
$post->content = "This is a test post by Services_Blogging\r\nSecond line\r\nThird one";

$bl->savePost($post);
echo 'post id: ' . $post->id . "\r\n";


$post->content = 'And this is a changed one';
$bl->savePost($post);
*/
/*
$post = $bl->getPost(-1);
var_dump($post);
/*
echo date('Y-m-d H:i:s', $post->date) . "\r\n";
*/
var_dump($bl->getRecentPostTitles());
コード例 #6
0
<?php

//auto-discover the blog settings
require_once 'Services/Blogging.php';
/*
$settings = Services_Blogging::discoverSettings('http://blog.bogo');
var_dump($settings);
echo Services_Blogging::getBestAvailableDriver($settings) . "\r\n";
*/
$bl = Services_Blogging::discoverDriver('http://blog.bogo', 'mylittlename', 's3rgq8cqr32');
var_dump($bl->getRecentPostTitles());
コード例 #7
0
<?php

require_once 'Services/Blogging.php';
$bl = Services_Blogging::factory('metaWeblog', 'mylittlename', 's3rgq8cqr32', 'http://mylittlename.bitclix.com', '/xmlrpc.php');
//$bl->setBlogId('28025532');
var_dump($bl->getRecentPosts());