Sign inSign up

barichello/elm

By barichello

•Updated over 6 years ago

Image
0

1.1K

barichello/elm repository overview

⁠cp-swf⁠

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 flash to display Club Penguin's SWF files, here are instructions on how to enable flash plugin:

OS installation:

Enabling flash on browser:

⁠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 [email protected]: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

Tag summary

Content type

Image

Digest

Size

47.7 MB

Last updated

almost 7 years ago

docker pull barichello/elm