Skip to content

abarichello/cp-swf

Repository files navigation

An interactive archive of Club Penguin SWFs by year.

About

Archive

The SWF archive is included as a git submodule, the repository can be found here: cp-swf-archive.
Feel free to contribute by adding any missing files.

Flash

This website uses Ruffle so a Flash installation isn't necessary

How it works

First a JSON file with the structure of the SWF folder is generated with tree -J cp-swf-archive, example:

[
  {"type":"directory","name":".","contents":[
    {"type":"directory","name":"2017","contents":[
      {"type":"directory","name":"default","contents":[
        {"type":"file","name":"attic.swf"},
        // ...
      ]},
    {"type":"directory","name":"unknown","contents":[
      {"type":"file","name":"party10solo.swf"},
        // ...
    ]}
  {"type":"report","directories":9,"files":98}
]

Then this JSON gets decoded into the following recursive custom type:

type alias Archive =
    List Node

type Node
    = Directory { name : String, contents : List Node }
    | File String
    | Report { directories : Int, files : Int }

This gives the necessary tree structure to represent the files, their hierarchy and the total number of files and directories.

Compiling and Debug

  1. Install Elm
  2. git clone --recursive git@github.com:aBARICHELLO/cp-swf.git
  3. Using elm-live: elm-live src/Main.elm --start-page=index.html -- --output=main.js --debug
  4. Update local archive file by running tree -J cp-swf-archive > cp-swf-archive/archive.json
  5. To use debug mode edit the flag in index.html to true, this redirects all archive requests to localhost:8000