Oops, missed this file.
Patch by yvi.
diffs (81 lines):
diff -r afe115ff71bd -r c2ddf1cae0c9 cgi-bin/DW/External/Site/Dreamwidth.pm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cgi-bin/DW/External/Site/Dreamwidth.pm Thu Jul 02 04:18:21 2009 +0000
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+#
+# DW::External::Site::Dreamwidth
+#
+# Class to support the Dreamwidth.org site.
+#
+# Authors:
+# Mark Smith <[email protected]>
+#
+# Copyright (c) 2009 by Dreamwidth Studios, LLC.
+#
+# This program is free software; you may redistribute it and/or modify it under
+# the same terms as Perl itself. For a copy of the license, please reference
+# 'perldoc perlartistic' or 'perldoc perlgpl'.
+#
+
+package DW::External::Site::Dreamwidth;
+
+use strict;
+use base 'DW::External::Site';
+use Carp qw/ croak /;
+
+
+# new does nothing for these classes
+sub new { croak 'cannot build with new'; }
+
+
+# returns 1/0 if we allow this domain
+sub accepts {
+ my ( $class, $parts ) = @_;
+
+ # allows anything at dreamwidth.org
+ return 0 unless $parts->[-1] eq 'org' &&
+ $parts->[-2] eq 'dreamwidth';
+
+ return bless { hostname => 'dreamwidth.org' }, $class;
+}
+
+
+# argument: DW::External::User
+# returns URL to this account's journal
+sub journal_url {
+ my ( $self, $u ) = @_;
+ croak 'need a DW::External::User'
+ unless $u && ref $u eq 'DW::External::User';
+
+# FIXME: this should do something like $u->is_person to determine what kind
+# of thing to setup...
+ return 'http://www.dreamwidth.org/users/' . $u->user . '/';
+}
+
+
+# argument: DW::External::User
+# returns URL to this account's journal
+sub profile_url {
+ my ( $self, $u ) = @_;
+ croak 'need a DW::External::User'
+ unless $u && ref $u eq 'DW::External::User';
+
+# FIXME: same as above
+ return 'http://www.dreamwidth.org/users/' . $u->user . '/profile';
+}
+
+
+# argument: DW::External::User
+# returns URL to the badge image (head icon) for this user
+sub badge_image_url {
+ my ( $self, $u ) = @_;
+ croak 'need a DW::External::User'
+ unless $u && ref $u eq 'DW::External::User';
+
+# FIXME: same as above
+ return "$LJ::IMGPREFIX/silk/identity/user.png";
+}
+
+
+1;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog