Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 809297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:42:20+00:00 2026-05-15T00:42:20+00:00

Prescript: The amazing etherpad was recently open sourced. Get it here: http://code.google.com/p/etherpad . This

  • 0

Prescript: The amazing etherpad was recently open sourced. Get it here: http://code.google.com/p/etherpad. This is the first question that I know of on StackOverflow about the etherpad code. If you’re part of the etherpad open source community, you might want to subscribe to the RSS feed for questions tagged ‘etherpad’ just in case this catches on!

My actual question, which assumes you have etherpad installed on your own server:

First, here’s a query to view recently edited pads:

SELECT id,lastWriteTime,creationTime,headRev 
  FROM PAD_SQLMETA ORDER BY lastWriteTime, headRev;

Or, if you want to run it from a unix prompt:

mysql -u root -pPASSWD etherpad -e "select id,lastWriteTime,creationTime,headRev 
  from PAD_SQLMETA order by lastWriteTime, headRev"

That’s handy, however lastWriteTime actually gets updated every time someone so much as views a pad in their browser. I’d rather sort the pads by when they were actually last edited. There’s probably a fancy SQL query involving a join with another table that would show actual last edit time. Does anyone know what that is? Alternatively, you could have a script that notices when headRev changes but that doesn’t seem like the cleanest way to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:42:20+00:00Added an answer on May 15, 2026 at 12:42 am

    I haven’t quite figured out the answer to my original question but I wrote a script that achieves something similar.
    It’s main purpose is to export plain text versions of all my pads and store them on my laptop.
    As a side effect it shows me which pads have changed and lets me see a diff since the last exported version.
    It also shows which ones were newly created.

    First, create the following script, padlist.pl, on the server that hosts your etherpad instance:

    #!/usr/bin/env perl
    
    $list = `mysql -u root -pPASSWD etherpad -e 
             "select id from PAD_SQLMETA order by lastWriteTime DESC, headRev DESC"`;
    
    $list =~ s/^id\s*\n//s;  # get rid of the column header mysql adds.
    print $list;
    

    Then run the following script, fetchall.pl, on your local machine.
    It will suck down snapshots of all your pads and tell you which ones have changed and which have newly appeared.

    #!/usr/bin/env perl
    
    use LWP::Simple qw(get);
    $| = 1;  # autoflush.
    $server = "server.com"; # the server that hosts your etherpad instance.
    
    $pads = `ssh $server etherpad/padlist.pl`;
    @padlist = split(/\s+/, $pads);
    
    $neednewline = 0; # printing "." for each pad where nothing to be done.
    for(@padlist) {
      $ep = $_;
      $localfile = "$ep.txt";
      if(-e $localfile) { 
        $localexists = 1; 
        $localcontent = do {local (@ARGV,$/) = $localfile; <>};
      } else { $localexists = 0; }
      $livecontent = get("http://$server/ep/pad/export/$ep/latest?format=txt");
      if($livecontent ne $localcontent) {
        if($neednewline) { print "\n";  $neednewline = 0; }
        if($localexists) { 
          print "CHANGED: $ep\n"; 
          open(F, ">prev/$localfile") or die "Probably need to create 'prev' dir.";
          print F $localcontent;
          close(F);
        } else { print "NEW:     $ep\n"; }
        open(F, ">$localfile") or die;
        print F $livecontent;
        close(F);
      } else {
        print ".";
        $neednewline = 1;
    } }
    

    To see a diff of pad foo since the last time I fetched it:

    diff prev/foo.txt foo.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 389k
  • Answers 389k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes that's true. At least for the Sun javac. Have… May 15, 2026 at 12:42 am
  • Editorial Team
    Editorial Team added an answer UIWebView* webView = [[UIWebView alloc] init]; May 15, 2026 at 12:42 am
  • Editorial Team
    Editorial Team added an answer Use MakeGenericType instead: Activator.CreateInstance(typeof(ObservableCollection<>).MakeGenericType(type)); May 15, 2026 at 12:42 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.