自动将iTunes中的选择歌曲列表添加到ecto

试了一下Automator,没有想像中好用,但也不至于象Applscript那么让我困惑了。
一直很想有一个简单办法可以帮助我把在iTunes中选中的歌曲添加到ecto中,那些iTunes To HTML的小程序都太overkill了。几翻尝试终于搞出了一个Automator Action,在iTunes中选中,然后再运行这个action就可以自动导入ecto了。下面用这个方法导出的近期“最爱”:

Song Album Artist
Galveston Loose - New Sounds Various Artists / Loose - New Sounds Of The Old West - Volume Three Sparklehorse
Lightning Frightening The Man Who Sold The World David Bowie
Pista 2 Award Winner STAN GETZ
07 - Marian Nouvelle vague Marc Collin
伍。赶路 镜花缘记 窦唯·Fm3
Denial Movement New Order
Tomorrow Never Knows Revolver The Beatles
2. Up From The Skies Axis Bold As Love Jimi Hendrix
Hey! Student Middle Class Revolt aka The Vapourisation Of Reality The Fall
Guns Of Brixton From Here To Eternity the clash

这个Action脚本共享在这里:
iTunes2Ecto.zip
将它解压到~/Library/Scripts下就可以在ScriptMenue里使用了。

发表评论

How to make ecto work with Ultimate Tag Warrior - Part II

[update: I have updated downloadable xmlrpc.php example for wordpress 2.1. It also fixes the wordpress 2.1 bug when getting category via xmlrpc. Check the end of the post. 2007-02-20]

I once wrote about “How to make ecto work with Ultimate Tag Warrior”. In that article, I discussed how to make the wordpress with UTW plugin recognize tag information sent by ecto. It works well except that some friends reported after the post is published, the tag information can not be stored in ecto. It means you lose track of all the tag information in ecto. When you edit a post, you have to set the tags again, which is very inconvenient.

From a post in the ecto forum, I knew that ecto recognizes mt_keywords. After some more hacking of xmlrpc.php, I fixed the problem. Now, you can not only use ecto to publish your post with tag information but also get tag information from your post. Here’s how (UPDATE: be sure to follow the steps in Part I before applying following steps. Thank Bruce for your reminding and all the helps):

First, you need to add one function in xmlrpc.php before the class wp_xmlrpc_server is defined:

/* ROBIN LU HACK get keywords */
function ecto_get_keywords($postid) {
$utw = new UltimateTagWarriorCore();
$tags = $utw->GetTagsForPost($postid);
$postkeywords = '';
if (is_array($tags)) {
foreach($tags as $data) {
if(!empty($data) &&
!empty($postkeywords))
$postkeywords .= ", ";
$postkeywords .= $data->tag;
}
}
return ($postkeywords);
}

Then, add this line

'mt_keywords' => ecto_get_keywords($postdata['ID']),

in function mw_getPost at where $resp is set:

$resp = array(
'dateCreated' => new IXR_Date($post_date),
'userid' => $postdata['post_author'],
'postid' => $postdata['ID'],
'description' => $post['main'],
'title' => $postdata['post_title'],
'link' => $link,
'permaLink' => $link,
// commented out because no other tool seems to use this
//	      'content' => $entry['post_content'],
'categories' => $categories,
'mt_excerpt' => $postdata['post_excerpt'],
'mt_text_more' => $post['extended'],
'mt_allow_comments' => $allow_comments,
//ROBIN LU HACK
'mt_keywords' => ecto_get_keywords($postdata['ID']),
'mt_allow_pings' => $allow_pings
);

Then add this line:

'mt_keywords' => ecto_get_keywords($entry['ID']),

in function mw_getRecentPosts() at where $struct[] is assigned like this:

$struct[] = array(
'dateCreated' => new IXR_Date($post_date),
'userid' => $entry['post_author'],
'postid' => $entry['ID'],
'description' => $post['main'],
'title' => $entry['post_title'],
'link' => $link,
'permaLink' => $link,
// commented out because no other tool seems to use this
//	      'content' => $entry['post_content'],
'categories' => $categories,
'mt_excerpt' => $entry['post_excerpt'],
'mt_text_more' => $post['extended'],
'mt_allow_comments' => $allow_comments,
//ROBIN LU HACK
'mt_keywords' => ecto_get_keywords($entry['ID']),
'mt_allow_pings' => $allow_pings
);

Save your xmlrpc.php and refresh in ecto. You will get all the tag information back to you.
There are xmlrpc.php files for different wordpress version:

53 条评论

MSN Spaces也可以用ecto发文了

MSN Spaces支持MetaWeblog API应该是老新闻了,我今天才知道,这意味着在mac上可以用ecto直接往MSN Spaces发文了。
具体的配制方式如下:

  1. 登录MSN Spaces,点击最右边的”Settings”,再选择”Email Publishing”。
  2. 启用email publishing。在”Turn on e-mail publising”前打勾。填好下面的内容,特别是密码,这将是ecto连接MSN Spaces所使用的密码。在第四条根据你自己的情况选,我选的是立即发布。最后保存设置。
  3. 配制你的ecto。加入一个新的账户。链接是”http://spaces.msn.com/你的msn spaces用户名”。ecto会自动填上xmlrpc点的链接,是”http://storage.msn.com/storageservice/MetaWeblog.rpc”。如果你发现链接有问题,可以换成”https://storage.msn.com/storageservice/MetaWeblog.rpc”。我使用的是https方式。用户名是你MSN Spaces链接里的用户名,不是你登录MSN使用的email地址。密码是你刚才在Email Publishing里设置的密码。

1条评论

Recent Posts:

Recent Comments:

Archive:

Tags:

Bookmarks:

My music:

About Me:

I am a software engineer in Beijing, China. I write code for work and for fun. I am interested in web technology, life hacking and console games. This blog is dumped from my left brain.
View Robin Lu's profile on LinkedIn

My Flickr:

    drawingAt Modern Sky Music FestivalIMG_0389IMG_0312urumqi panaramaIMG_9664

Friends: