Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 2799 Bytes
1 | module BloggerStructs |
2 | class Blog < ActionWebService::Struct |
3 | member :url, :string |
4 | member :blogid, :string |
5 | member :blogName, :string |
6 | end |
7 | class User < ActionWebService::Struct |
8 | member :userid, :string |
9 | member :firstname, :string |
10 | member :lastname, :string |
11 | member :nickname, :string |
12 | member :email, :string |
13 | member :url, :string |
14 | end |
15 | end |
16 | |
17 | |
18 | class BloggerApi < ActionWebService::API::Base |
19 | inflect_names false |
20 | |
21 | api_method :deletePost, |
22 | :expects => [ {:appkey => :string}, {:postid => :int}, {:username => :string}, {:password => :string}, |
23 | {:publish => :bool} ], |
24 | :returns => [:bool] |
25 | |
26 | api_method :getUserInfo, |
27 | :expects => [ {:appkey => :string}, {:username => :string}, {:password => :string} ], |
28 | :returns => [BloggerStructs::User] |
29 | |
30 | api_method :getUsersBlogs, |
31 | :expects => [ {:appkey => :string}, {:username => :string}, {:password => :string} ], |
32 | :returns => [[BloggerStructs::Blog]] |
33 | |
34 | api_method :newPost, |
35 | :expects => [ {:appkey => :string}, {:blogid => :string}, {:username => :string}, {:password => :string}, |
36 | {:content => :string}, {:publish => :bool} ], |
37 | :returns => [:int] |
38 | end |
39 | |
40 | |
41 | class BloggerService < TypoWebService |
42 | web_service_api BloggerApi |
43 | before_invocation :authenticate |
44 | |
45 | def deletePost(appkey, postid, username, password, publish) |
46 | article = this_blog.articles.find(postid) |
47 | article.destroy |
48 | true |
49 | end |
50 | |
51 | def getUserInfo(appkey, username, password) |
52 | BloggerStructs::User.new( |
53 | :userid => username, |
54 | :firstname => "", |
55 | :lastname => "", |
56 | :nickname => username, |
57 | :email => "", |
58 | :url => controller.url_for(:controller => "/") |
59 | ) |
60 | end |
61 | |
62 | def getUsersBlogs(appkey, username, password) |
63 | [BloggerStructs::Blog.new( |
64 | :url => controller.url_for(:controller => "/"), |
65 | :blogid => 1, |
66 | :blogName => this_blog.blog_name |
67 | )] |
68 | end |
69 | |
70 | def newPost(appkey, blogid, username, password, content, publish) |
71 | title, categories, body = content.match(%r{^<title>(.+?)</title>(?:<category>(.+?)</category>)?(.+)$}mi).captures rescue nil |
72 | |
73 | article = this_blog.articles.build |
74 | article.body = body || content || '' |
75 | article.title = title || content.split.slice(0..5).join(' ') || '' |
76 | article.published = publish |
77 | article.author = username |
78 | article.published_at = Time.now |
79 | article.user = @user |
80 | article.allow_comments = this_blog.default_allow_comments |
81 | article.allow_pings = this_blog.default_allow_pings |
82 | article.text_filter = this_blog.text_filter |
83 | article.save |
84 | |
85 | if categories |
86 | categories.split(",").each do |c| |
87 | article.categories << Category.find_by_name(c.strip) rescue nil |
88 | end |
89 | end |
90 | |
91 | article.id |
92 | end |
93 | |
94 | end |