HellOnline

Icon

Eran's blog

  • Frontpage
    Return home
  • Browse
    By topic
  • Subscribe
    RSS feed
  • Events
  • Fiction
  • gaming
  • General
  • Java
  • Projects
  • Ruby on Rails
  • Social Software
  • The Net
    • Aggregation
    • MicroFormats
    • Mobile
    • Search
    • Tagging

August 25, 2006 • 11:17 am 1

Where Could Tribe Go?

So now that we know for sure that Mark Pincus is getting the old band back together again it’s time to start the wild speculation. What could Mark & co. do to make tribe an active and lively site and even more important, can they make it a profitable venture?

One of the old issues that tribe is still facing is the mature content and public decency quagmire. Tribe’s recent handling of that alienated many of their existing user base and inspired the creation of competing sites and several mass exits. Is it possible to allow all users the online freedom they desire while still maintaining the veneer of a serious web site and not hurting the sensibilities of the rest of the users? I’ve seen a few attempts at that and some very good ideas, from using multiple personalities federated under one account to creating tribe rings where whole rings could possibly be private or invisible to non-members.

In my experience tribe’s strongest when it’s concentrated and local. Of course, living in San Francisco I got to see more of that than most people. Tribe was one of the first to have parties or socials for its members. Lately we’ve seen meetups, parties and proms from various web 2.0 sites, some organized by members and others more “official.â€? Bringing back the local feeling to tribe would be great but can tribe do that outside of the Bay Area as well?

I’ve seen some tribe-connected communities in other cities (Portland, OR and Seattle, WA come to mind) and I’ve seen similarly connected communities using different services (Livejournal seems to still be very strong in Austin, TX). What could tribe do to make its presence felt in more locations? How could tribe overcome the paradox of becoming more local while being more global? I’ve no doubt that this would require more than technology, is it pure chance that here in tribe’s home city, tribe is at its strongest? Unlikely. The local presence and the connections between tribe’s founders and employees to the local community had a lot to do with that. Maybe tribe should start franchising? A local tribe franchise would be in charge of keeping in touch with the local community, of creating real-life events and helping to modify the online experience to better match its own community. The franchise would share in the revenue brought in from the local community, hopefuly, making this a positive venture for all.

From a technology stand point, I’ve suggested long ago that tribe become more of a platform. An outsourced community tool including a community. While more and more web sites now come with their own community tools built in (see flickr, vox, etc.) there is also more demand for this kind of functionality in other sites. Tribe did make a small attempt at that when they announced the sponsored (or branded) tribes feature (see the scion tribe). It seems though, that this was too little and too late. AFAIK no other sponsored tribes were ever announced and the scion tribe itself was never all the successful.

Of course, we’d all love to see tribe go on moving in the open direction. More feeds, more standards, Microformats, export features and APIs are all becoming standard in today’s web apps and tribe is lagging behind. Tribe’s modular user profiles would be ever more useful if they included an feed that mashes up all the various content sources included in a profile. Tribe’s events would be great if they included an option to synchronize with Google calendar or Outlook 2007. I’d be much more likely to post my event on Tribe (instead of upcoming, for example) if I knew that it is easier for my friends to use it and (as a promoter) if I knew that said event would get syndicated on other sites as well (say, evdb and related sites). If tribe would come clean on content ownership and let users control and export their content, they would gain much good will from a community of people they recently alienated. They would also become more attractive to people who value their content (as should we all) and want to have more control over it than offered in most sites. With open platforms there’s no limit to the cool ideas people might come up with.

I could go on forever but I guess this should be enough for now. The next few weeks should be very exciting to everyone involved, let’s just hope that the revolution of the ants is successful and that tribe becomes fun once more.

Filed under: The Net

August 24, 2006 • 8:07 pm 4

Tribe is Stirring?

The following listing from Mark Pincus just showed up on my radar:

hey, this is an informal announcement that as of today jan and the board are gone. i’ve taken over tribe and you’re going to see big changes fast like getting rid of this big stupid masthead and returning tribe to the users where it belongs.

best,

mark

(Jan is Jan Gullet, tribe’s new CEO)

Could it be true? After all the recent tribe rumors i’m willing to believe pretty much anything. What would this mean for tribe? Will it finally get its groove back? Who knows… maybe it’s time to go over my tribe wish-list again (go microformats! go go API powers!).

Update: More wild speculation here.

Filed under: The Net

August 18, 2006 • 5:25 pm 3

HowTo: Using Acts as Wiki to Create a Smarter Blog

This post is a tutorial on how to use the Acts as Wiki rails plugin. It assumes you’re already somewhat familiar with ruby and ruby on rails. If you’re not, check out the rails website, it has some good starting points. You can see the full source code for this project on trac or download it as a zip file.

It’s common practice among bloggers to mark updates to existing posts with <INS> and <DEL> tags or similar methods. Wouldn’t it be easier if the content of each post was a wiki? Anyone would be able to see the full revision history of every one of your posts and full disclosure would be served. Using the Acts as Wiki plugin we can achieve just that.

First let’s create the database we’ll be using, call it a bliki (blog + wiki). Once that’s done go ahead and create the rails application itself

rails bliki

Edit database.yml to include the correct details and then go on to create the Posts table, we’ll use a migration for that:

class CreatePosts true
t.column :subject, :string
t.column :content, :text
t.column :created_at, :datetime, :null => false
t.column :updated_at, :datetime, :null => false
end
end

def self.down
drop_table 'Posts'
end
end

Run the migration

rake db:migrate

Now create your Post scaffold.

ruby script/generate scaffold Post

It’s now time to install the Acts as Wiki plugin, just like it says in the Readme:

script/plugin install http://www.hellonline.com/svn/hellonline/plugins/acts_as_wiki/
script/generate acts_as_wiki
rake db:migrate

Now lets use acts_as_wiki on the content field of the Post class and throw in a markdown fitler as well, just to make things pretty

class Post < ActiveRecord::Base
acts_as_wiki :content, Filters.method(:markdown)
end

Let’s display the all the posts in a list, you can see the full view code here but the interesting lines follow:

And later

'revisions', :action => 'history', :type => post.class, :o bj_id => post.id, :title => :content %>

The first one displays the post’s content after passing it through the markdown filter (if you want the raw content, just use post.content as you would otherwise). The second one links to the revision history of this field. The link requires the containing object type and id and the field’s name (supplied under :title). We need to make similar changes to show.rhtml too.

We can also make use of the new update_attirbutes(attributes, author_name) method. Go into post_controller.rb and change the update method to the following:

def update
@post = Post.find(params[:id])
if @post.update_attributes(params[:post], params[:post][:author_name]) # 'show', :id => @post
else
render :action => 'edit'
end
end

This will record the author name along with the new revision. If you want to record that detail for revert actions as well, you’ll need to change revisions_controller.rb. In the revert method change the call to obj.revert() to something like:

obj.revert(@revision.field_name, @revision.id, @session[:username])

This assumes, of course, that you’re using the session variable username to store the current user’s name.

To make things a bit clearer change the post’s _form.rhtml partial, we don’t need to provide anything beyond an author’s name, a subject and the post’s content:

Author name

Subject

Content

That’s it. Start your server and go to http://localhost:3000/posts/. Create a new post (you can use some markdown if you want to), edit it, check out the history, compare revisions, revert to a previous revision. Isn’t this fun?

Filed under: Projects, Ruby on Rails

August 16, 2006 • 5:48 pm 1

Acts as Wiki

A wiki is a very useful thing. In fact many times I’ve wanted to have just one field in a class be a wiki. This behavior is even more desirable with all the Web 2.0 user-generated content type sites coming out lately. The way I see it, Wikis have two useful features:

  1. Revision history – so you don’t have to worry too much about vandalism, opinionated authors, etc.
  2. Markdown or similar filter to make rich content authoring simple and safe.

One of my first additions to WhereAreYouCamping.com (WAYC) was the versioning code. Anybody can edit camp content and so the site is left wide open to vandalism. The code for that is pretty simple


class Camp 'Revision',
:foreign_key => 'camp_id',
:conditions => "field_name = 'description'",
:o rder => "id DESC"
before_save :revise(‘description’)

The revise function is in charge of creating a new revision if the current value for the description field is different from the previous value. I’m omitting it for brevity.

This is very simple and works pretty well as a simple backup method. You can probably imagine that with some pretty simple code in the Revisions_Controller it easy to show the revision history of a field, diff revisions and revert to a previous one. On the other hand, this solution is lacking author details and a few other niceties but the biggest disadvantage is, of course, lack of DRYness. This method is not at all reusable; in fact additional wikified fields requires much replicated code. Enter acts_as_wiki.

Acts_as_wiki is a mixin (soon to be a plugin, I hope) that lets you do all that with one line of code:

acts_as_wiki [:description, :events], Filters.method(‘markdown’)

Adds revisions (with history, diff and revert) and markdown filtering (or whichever filter you decide to use if at all) to the description field. Here’s a simplified version of the method:


def acts_as_wiki(field, filter = nil)
# remember the filter for this field.
Filter_hash[field.to_s] = filter
# add reader to filtered field content
module_eval "def #{field}_filtered self.get_filtered('#{field}'); end"
# add the revisions relation
has_many("#{field}_revisions".to_sym,
:class_name => 'Revision',
:foreign_key => 'obj_id',
:conditions => "field_name = '#{field}' and obj_type = '#{self.class}'",
:o rder => "id DESC",
:as => 'obj')
}
before_save Proc.new{|obj| obj.revise(field)}
end

To record the author who created a revision I’ve updated the update_attributes method:


attr :current_author, true

def update_attributes(attributes, author_name = 'unknown')
self.current_author = author_name
# let super handle the actual update
super(attributes)
end

Later in revise() I refer to current_author to get the author’s details. This can be expanded to support a more complex user model. For content filtering I’ve added the get_filtered method which is used by the FIELD_NAME_fieltered method (mentioned above):


def get_filtered(field_name)
content = self.send(field_name)
filter = Filter_hash[field_name.to_s]
if filter
return filter.call(content)
else
return content
end
end

This allows the programmer to continue accessing the raw field value (as stored in the database) using the field name and so requires very little change throughout the application.

Revisions are simple creatures:


create_table "revisions" do |t|
t.column "created_at", :datetime, :null => false
t.column "revised_at", :datetime, :null => false
t.column "content", :text, :default => "", :null => false
t.column "author", :string, :limit => 60
t.column "obj_type", :string
t.column "obj_id", :integer, :null => false
t.column "field_name", :string, :limit => 20
end

Similarly, the Revision model needs very little besides the relationship to its owner:


class Revision 'obj_id', :polymorphic => true
# some helper functions for browsing through revisions
def prev_rev
Revision.find(:first,
:conditions => ['id 'id DESC') rescue nil
end
def next_rev
Revision.find(:first,
:conditions => ['id > ? AND field_name = ? AND obj_type = ? AND obj_id = ?', self.id, self.field_name, self.obj_type, self.obj_id]) rescue nil
end
def last_rev
Revision.find(:first,
:conditions => ['id >= ? AND field_name = ? AND obj_type = ? AND obj_id = ?', self.id, self.field_name, self.obj_type, self.obj_id],
:o rder => 'id DESC') rescue nil
end
end

The revisions controller is also pretty simple. The basic actions: history, show and revert pretty much write themselves. The diff action is just as easy once you use the diff method from instiki.

And there you have it. The field[s] of your choice can now be a full blown wiki with revision history, markdown, the works. You can see the rest of the code on trac.

Update: I’ve put up a plugin, you can install it using

script/plugin install http://www.hellonline.com/svn/hellonline/plugins/acts_as_wiki

generate the code and migrate your db using


script/generate acts_as_wiki
rake db:migrate

Update 2: Just posted a tutorial on how to use the Acts as Wiki plugin.

Filed under: Projects, Ruby on Rails

Pages

  • About Me

Archives

  • April 2009
  • March 2009
  • February 2009
  • December 2008
  • November 2008
  • September 2008
  • August 2008
  • March 2008
  • February 2008
  • January 2008
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005

Meta

  • Register
  • Log in
  • Valid XHTML
  • XFN
  • WordPress

Blogroll

  • Ashton
  • Assaf
  • AvaPeeps BlogNation
  • Captured
  • Crimson Canary BioTech Search Services
  • del.icio.us
  • flickr
  • Gamasutra Feature Articles
  • Google Blog
  • Google Weblog
  • I Blame Beer
  • Laughing Squid
  • Marc’s Voice
  • Mark Pincus Blog
  • My brother’s surfboard repair shop in Waikiki
  • Ongoing
  • Prof. David Wolber
  • Riding Rails
  • Ryan King
  • supr.c.ilio.us: The Blog
  • Tantek Çelik
  • Tara Hunt
  • Technorati Profile
  • The Search Guy
  • tribe.net
  • zengestrom.com
  • Frontpage
    Return home
  • Browse
    By topic
  • Subscribe
    RSS feed
  • Events
  • Fiction
  • gaming
  • General
  • Java
  • Projects
  • Ruby on Rails
  • Social Software
  • The Net
    • Aggregation
    • MicroFormats
    • Mobile
    • Search
    • Tagging

Blog at WordPress.com.

Theme: Grid Focus by Derek Punsalan.