Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abarichello/cp-swf

Interactive archive of Club Penguin SWFs by year
https://github.com/abarichello/cp-swf

club-penguin club-penguin-swfs clubpenguin flash swf

Last synced: 10 days ago
JSON representation

Interactive archive of Club Penguin SWFs by year

Awesome Lists containing this project

README

        

# [cp-swf](https://cpswf.barichello.me/)

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](https://gitlab.com/BARICHELLO/cp-swf-archive).

Feel free to contribute by adding any missing files.

## Flash

This website uses [Ruffle](https://github.com/ruffle-rs/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:
```json
[
{"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:
```elm
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](https://guide.elm-lang.org/install/elm.html)
1. `git clone --recursive [email protected]:aBARICHELLO/cp-swf.git`
1. Using elm-live: `elm-live src/Main.elm --start-page=index.html -- --output=main.js --debug`
1. Update local archive file by running `tree -J cp-swf-archive > cp-swf-archive/archive.json`
1. To use debug mode edit the flag in `index.html` to `true`, this redirects all archive requests to `localhost:8000`