Run it
- get Scheme 48 1.9, then run this:
scheme48 ,open exceptions extended-ports tables define-record-types posix-files filenames posix-regexps posix-time ,load extract-cufp-web.scm (define ps (extract-cufp-website "cufpdev.sql"))
- For JSON output:
(write-pages-to-json ps "pages.json")
- For Jekyll output:
- create an output directory like so:
rm -rf web && ( mkdir web && ln -s ../jekyll/_layouts web )
- then do this:
(write-pages-to-jekyll ps "web")
- run Jekyll like so:
cd web jekyll
Plan
- parse the SQL: escapes are \r\n, ”
- fix up links later
Parsing the SQL
That’s what to look for:
-- Dumping data for table `node_revisions` -- INSERT INTO `node_revisions` (`nid`, `vid`, `uid`, `title`, `body`, `teaser`, `log`, `timestamp`, `format`) VALUES (1, 1, 39, 'Functional Programming in Action', 'Functional programming languages have been a hot topic of academic research for over 35 years, and are rapidly being adopted in diverse real-world settings ranging from from tech start-ups to financial and biomedical firms. At the same time, a vigorous community of practically-minded functional programmers has come into existence.\r\n\r\nCUFP is a yearly workshop aimed at serving this community. The 2012 conference is in Copenhagen, from September 13th-15th. Once again, it is co-located with [ICFP 2012](http://icfpconference.org/icfp2012/).', 'Functional programming languages have been a hot topic of academic research for over 35 years, and are rapidly being adopted in diverse real-world settings ranging from from tech start-ups to financial and biomedical firms. At the same time, a vigorous community of practically-minded functional programmers has come into existence.\r\n\r\nCUFP is a yearly workshop aimed at serving this community. The 2012 conference is in Copenhagen, from September 13th-15th. Once again, it is co-located with [ICFP 2012](http://icfpconference.org/icfp2012/).', '', 1327346001, 1), [...] (3430, 3430, 0, 'Malina Gomez - Profile ', '', '', '', 1322943204, 1);
I.e. the semicolon instead of the comma terminates
Ruby query:
QUERY = "SELECT n.nid, \ n.title, \ nr.body, \ n.created, \ n.status \ FROM node AS n, \ node_revisions AS nr \ WHERE (n.type = 'job' OR n.type = 'page' OR n.type = 'conference_data' OR n.type = 'conference_info' OR n.type = 'news' OR n.type = 'session' OR n.type = 'user_profile' OR n.type = 'videos') \ AND n.vid = nr.vid"
Then url_alias
tells us what the URL actually was.
aliases = db["SELECT dst FROM #{prefix}url_alias WHERE src = ?", "node/#{node_id}"].all
So, start with node
to build a table of entries, index that by
node.nid
(to xref with node_revisions
), put the urls in via
url_alias
, then do another pass, writing out directly the pages.
cufphtml
sites/all/files
has all the static files.
Templates
are sites/all/themes/cufpZen
, particularly
sites/all/themes/cufpZen/blocks
, but we can probably extract them
from sites/all/cache/normal/cufp.org
.
MySql
Start:
env TMPDIR=/var/tmp /usr/local/mysql/bin/mysqld_safe
Password: WI…
User data
users:
(26, ‘jheard’, ‘3914331b7dba8bad1293e97f85f3d83d’, ‘jeff@renci.org’, 0, 0, 0, ”, ”, 0, 1264623114, 1264623114, 0, 1, NULL, ”, ‘sites/all/files/userPictures/picture-26.jpg’, ‘jeff@renci.org’, ‘a:7:{s:13:”form_build_id”;s:37:”form-dd866afa33855c37a12324350915ae7d”;s:6:”format”;s:1:”1”;s:7:”contact”;i:1;s:24:”xmlsitemap_user_priority”;s:2:”-2”;s:9:”nodewords”;a:7:{s:8:”abstract”;a:1:{s:5:”value”;s:0:”“;}s:9:”canonical”;a:1:{s:5:”value”;s:0:”“;}s:9:”copyright”;a:1:{s:5:”value”;s:0:”“;}s:11:”description”;a:1:{s:5:”value”;s:0:”“;}s:8:”keywords”;a:1:{s:5:”value”;s:0:”“;}s:13:”revisit-after”;a:1:{s:5:”value”;s:1:”1”;}s:6:”robots”;a:2:{s:5:”value”;a:6:{s:9:”noarchive”;i:0;s:8:”nofollow”;i:0;s:7:”noindex”;i:0;s:5:”noodp”;i:0;s:9:”nosnippet”;i:0;s:6:”noydir”;i:0;}s:11:”use_default”;i:0;}}s:14:”picture_delete”;s:0:”“;s:14:”picture_upload”;s:0:”“;}’, ”),
node_revisions:
(34, 34, 1, ‘Jefferson Heard - Profile 34’, ‘<p>\r\nI am an accomplished programmer, with 10 years experience in C++ and Java (with J2EE), as well as 7 years experience in Common Lisp, Python, and Perl, 3 years experience in Haskell, as well as having programming experience in several other languages. </p>\r\n<p>\r\nI have a great amount of experience with large structured and unstructured (text) databases, both in designing the data layouts and in building, querying, and designing systems that can use such data most effectively. In the past, i”ve built multi-terabyte multisouce integrated (mined) databases, terascale search systems for freeform keyword search and complex boolean information retrieval, search mediation systems.</p>\r\n<p>\r\nI currently work in visualization, specifically writing new interactive 3-dimensional visualizations which scale to massive datasets, structured, semistructured, and unstructured\r\n</p>’, ‘<p>\r\nI am an accomplished programmer, with 10 years experience in C++ and Java (with J2EE), as well as 7 years experience in Common Lisp, Python, and Perl, 3 years experience in Haskell, as well as having programming experience in several other languages. </p>’, ”, 1289353191, 1),
node:
(34, 34, ‘user_profile’, ”, ‘Jefferson Heard - Profile 34’, 26, 1, 1264623115, 1289353191, 0, 0, 0, 0, 0, 0),
term_data:
(43, 2, ‘Veracentra’, ”, 0), (31, 4, ‘Haskell’, ”, 0),
INSERT INTO `term_node` (`nid`, `vid`, `tid`) VALUES
(34, 34, 43), (34, 34, 31),
Links
<a href=''<?php print url(''user/13'');?>''>Francesco Cesarini</a> <a href="<?php print url(''node/143''); ?>">Bylaws</a> [T2: JaneStreet''s OCaml Core Library](http://cufp.org/conference/sessions/2011/t2-janestreets-ocaml-core-library)
users
table, example http://cufp.org/users/francescoc:
(13, 'francescoc', 'ca19c68b001f1b2b04ed7129ee97a5e8', 'francesco@erlang-solutions.com', 0, 0, 0, '', '', 0, 1264557661, 1309539055, 1309517203, 1, NULL, '', 'sites/all/files/userPictures/picture-13.jpg', 'francesco@erlang-consulting.com', 'a:8:{s:13:"form_build_id";s:37:"form-4d1f7af76641bc794a531d6dac1ecb2e";s:6:"format";s:1:"1";s:7:"contact";i:1;s:9:"nodewords";a:7:{s:8:"abstract";a:1:{s:5:"value";s:0:"";}s:9:"canonical";a:1:{s:5:"value";s:0:"";}s:9:"copyright";a:1:{s:5:"value";s:0:"";}s:11:"description";a:1:{s:5:"value";s:0:"";}s:8:"keywords";a:1:{s:5:"value";s:0:"";}s:13:"revisit-after";a:1:{s:5:"value";s:1:"1";}s:6:"robots";a:2:{s:5:"value";a:6:{s:9:"noarchive";i:0;s:8:"nofollow";i:0;s:7:"noindex";i:0;s:5:"noodp";i:0;s:9:"nosnippet";i:0;s:6:"noydir";i:0;}s:11:"use_default";i:0;}}s:24:"xmlsitemap_user_priority";s:2:"-2";s:14:"picture_delete";i:0;s:14:"picture_upload";s:0:"";s:16:"roleassign_roles";a:2:{i:3;i:3;i:5;i:5;}}', ''), (19, 'avsm', 'c6aaa9b58e038f15f5e613e9560a4b15', 'anil@recoil.org', 0, 0, 0, '', '', 0, 1264558164, 1329296410, 1329296410, 1, NULL, '', 'sites/all/files/userPictures/picture-19.jpg', 'anil@recoil.org', 'a:8:{s:13:"form_build_id";s:37:"form-164a00a0ad0328c193ad0a529e8d9f9f";s:6:"format";s:1:"1";s:7:"contact";i:1;s:24:"xmlsitemap_user_priority";s:2:"-2";s:9:"nodewords";a:7:{s:8:"abstract";a:1:{s:5:"value";s:0:"";}s:9:"canonical";a:1:{s:5:"value";s:0:"";}s:9:"copyright";a:1:{s:5:"value";s:0:"";}s:11:"description";a:1:{s:5:"value";s:0:"";}s:8:"keywords";a:1:{s:5:"value";s:0:"";}s:13:"revisit-after";a:1:{s:5:"value";s:1:"1";}s:6:"robots";a:2:{s:5:"value";a:6:{s:9:"noarchive";i:0;s:8:"nofollow";i:0;s:7:"noindex";i:0;s:5:"noodp";i:0;s:9:"nosnippet";i:0;s:6:"noydir";i:0;}s:11:"use_default";i:0;}}s:14:"picture_delete";i:0;s:14:"picture_upload";s:0:"";s:16:"roleassign_roles";a:2:{i:3;i:3;i:5;i:0;}}', ''),
node_revisions
has this, which is what’s in the page. (It looks
like Francesco has updated it since.)
(16, 16, 1, 'Francesco Cesarini - Profile 16', 'Founder and Chief Strategy officer at Erlang Solutions. Worked with the ACM SIGPLAN Erlang workshop since it was first sponsored by ACM in 2002. Co-Chair and frequent speaker at CUFP. Started the Erlang Factory, commercial Erlang conferences and training in London and San Francisco. We now also run the Erlang User Conference on behalf of Ericsson. Author of Erlang Programming, an animal guide published by O''Reilly media in 2009. <p>Erlang Solutions: http://www.erlang-solutions.com</p><p>Erlang Factory: http://www.erlang-factory.com</p><p>''Erlang Programming'' by Francesco Cesarini and Simon Thompson: http://www.erlangprogramming.org/</p>', 'Founder and Chief Strategy officer at Erlang Solutions. Worked with the ACM SIGPLAN Erlang workshop since it was first sponsored by ACM in 2002. Co-Chair and frequent speaker at CUFP. Started the Erlang Factory, commercial Erlang conferences and training in London and San Francisco. We now also run the Erlang User Conference on behalf of Ericsson. Author of Erlang Programming, an animal guide published by O''Reilly media in 2009. ', '', 1289352316, 1), (22, 22, 1, 'Anil Madhavapeddy - Profile 22', '<p>Recoil: http://anil.recoil.org</p>', '', '', 1289352662, 1),
These have node URLs like so:
hidden/profile/francesco-cesarini-profile-16 hidden/profile/anil-madhavapeddy-profile-22.html
But these really are just snippets.
The link is in node
, I think, where the reference to users
is in
the uid
field:
(16, 16, 'user_profile', '', 'Francesco Cesarini - Profile 16', 13, 1, 1264557662, 1289352316, 0, 0, 0, 0, 0, 0), (22, 22, 'user_profile', '', 'Anil Madhavapeddy - Profile 22', 19, 1, 1264558164, 1289352662, 0, 0, 0, 0, 0, 0),
Posts
Need to get stuff in news/
in Jekyll format.
Posts layout
Sessions
Currently sits in conference/sessions/
Tables:
content_type_session
node
.
(45, 45, 'session', '', 'Keynote: Real world Haskell.', 1, 1, 1264625691, 1265659672, 2, 0, 0, 0, 0, 0),
node_revisions
:
(45, 45, 1, 'Keynote: Real world Haskell.', 'Bryan will talk about how the book "Real World Haskell" came to be, and the response that it has received since publication. He will also discuss the opportunities presented, and the challenges faced, by functional languages in open source and in industry. ', 'Bryan will talk about how the book "Real World Haskell" came to be, and the response that it has received since publication. He will also discuss the opportunities presented, and the challenges faced, by functional languages in open source and in industry. ', '', 1265659672, 1),
This has no entry in content_type_session
.
Also:
node
:
(3216, 3216, 'session', '', 'T6: Systems Programming in Scala (Steven Jenson, Marius Eriksen)', 39, 1, 1310905503, 1314900881, 2, 0, 0, 0, 0, 0),
node_revisions
:
(3216, 3216, 39, 'T6: Systems Programming in Scala (Steven Jenson, Marius Eriksen)', 'In this tutorial you will learn Scala from a *systems programming*\r\ncentric point of view. By the end of the tutorial you will have built\r\na simple, robust and performant distributed search engine for tweets\r\nusing many functional programming idioms in a systems context. Scala\r\nis a large language, so we won''t cover every nook and cranny. However,\r\nthe most important concepts will be covered, and participants will be\r\nleft with experience with writing a non-trivial Scala application and\r\nwith the skills to learn the rest by themselves.\r\n\r\nWe start out by teaching the basic Scala concepts and language syntax.\r\n\r\n## Basic Language Concepts\r\n\r\n- Functions, Classes, Methods, Inheritance, `try-catch-finally`.\r\n Value-oriented programming\r\n- Lists, Maps, functional combinators: `map`, `foreach`, `filter`,\r\n `zip`, `folds`\r\n- Case Classes, Objects, Packages, `apply`, `update`, Functions are\r\n Objects (Uniform Access Principle), Basic Pattern Matching\r\n- `PartialFunction` and advanced Pattern Matching\r\n- A Tour of the Scala Collections library\r\n\r\nNext we introduce a few Twitter-specific concepts that will be used in\r\nour example application\r\n\r\n## Twitter Concepts\r\n- Tweets, Twitter Streaming API\r\n- `Future` and Finagle\r\n\r\nFollowed by building our example application: a distributed search\r\nengine for tweets built using functional concepts\r\n\r\n## Build our Search Application\r\n- Read Tweets: Read fake data\r\n- Index Tweets: Building a functional indexer\r\n- Query Tweets: Read from the index\r\n- Use _Your_ Tweets: Read from Twitter''s Streaming API\r\n- Distributed Indexing\r\n- Run multiple indexers\r\n- query in parallel and merge results\r\n\r\nLastly we will discuss how these functional concepts map onto the\r\nobject-oriented JVM.\r\n\r\n## How Scala concepts translate to Java\r\n- Classes\r\n- Bytecode\r\n\r\n', 'In this tutorial you will learn Scala from a *systems programming*\r\ncentric point of view. By the end of the tutorial you will have built\r\na simple, robust and performant distributed search engine for tweets\r\nusing many functional programming idioms in a systems context. Scala\r\nis a large language, so we won''t cover every nook and cranny.', '', 1314900881, 1),
content_type_session
:
(3216, 3216, 1316782800, 1316795400, '## Audience\r\n\r\nWe assume attendees have working knowledge of basic functional\r\nprogramming constructs such as pattern matching, higher order\r\nfunctions and recursion. Basic knowledge of object oriented\r\nprogramming (classes, methods, inheritance) is also required.\r\nFamiliarity with Java concepts is a plus, but not required.\r\n\r\n## Software Prerequisites\r\n\r\n- A Twitter account\r\n- A working Java (JVM) installation\r\n- The [bootstrap tarball](http://cufp.org/sites/all/files/uploads/scalaschool.tgz), also available [online](http://twitter.github.com/scala_school/).\r\n\r\n## Steve Jenson\r\n\r\nAn engineer at Twitter since 2008 focused on building Scala\r\napplications and libraries for high-volume systems. He has been\r\nprogramming on the JVM since 1999 and in Scala since 2007. He''s a\r\ncontributor to a number of open source Scala libraries.\r\n\r\n## Marius Eriksen\r\n\r\nMarius works on systems infrastructure at Twitter. He has worked on\r\nRPC and streaming systems, profiling tools, storage & indexing systems\r\nand our front-end serving stack. He loves applying functional\r\nprogramming techniques to these domains.\r\n\r\n\r\n', 1),
Need to get the dates in there; also, overview pages.
content_field_session_speaker
:
(45, 45, 0, 25),
^^ this is Bryan’s uid
layout
speaker full name
link to speaker page?
Session files …
See
http://cufp.org/conference/sessions/2009/keynote-real-world-haskell
content_field_session_file
:
(45, 45, 0, 2, 1, 'a:9:{s:11:"description";s:19:"Presentation Slides";s:8:"duration";i:0;s:6:"height";i:0;s:5:"width";i:0;s:18:"audio_bitrate_mode";s:0:"";s:18:"audio_channel_mode";s:0:"";s:12:"audio_format";s:0:"";s:13:"audio_bitrate";i:0;s:17:"audio_sample_rate";i:0;}'),
This must refer somehow to this from files
, via its fid
field,
linked to the uid
field above?
(2, 1, 'OSullivanBryan.pdf', 'sites/all/files/sessionFiles/OSullivanBryan.pdf', 'application/pdf', 5408871, 1, 1264661683),
session videos
News directory etc.
Extract rudimentary CSS
files
Github
Rope in Ashish
Improvements
Tomas Petricek
- On the conference page (http://cufp.org/conference), I would show some
basic information (already there) and schedule (instead of Program Chairs & Organizers). Attendees are probably looking for the program more than for the organizers (who can be in a separate page somewhere else).
- Is there a way to put more prominent banner on the home page
(http://cufp.org)? For example, using the nice Copenhagen photo and links to everything just below the introductory text and above the “Recent news” listing?
I know it might be hard to do some of these in the site management systme - but these are just some thoughts to make the conference & important information easier to find.
Thanks! Tomas
PS: I would probably also move the login bar somewhere else (below the other bar on the right?). I do not really know why people should login - it definitely is not required for the registration, so this seems to be more “internal” stuff for existing functional programmers who want to have their photo listed :-).