Package: mementoembed
MementoEmbedMementoEmbed is a tool to create archive-aware embeddablesurrogatesfor archived web pages (mementos), like thesocial cardabove. MementoEmbed is different from other surrogate-generation systems in that it provides access to archive-specific information, such as the original domain of the URI-M, its memento-datetime, and to which collection a memento belongs.MementoEmbed can also createbrowser thumbnailslike the one below.In addition, MementoEmbed can createimagereels, animated GIFs of the best five images from the memento, as seen below.For more information on this application, please visit ourDocumentation Pageand read theoriginal blog post describing the reasons behind MementoEmbed.Installation and ExecutionInstalling and Running the Latest Build Using DockerBecause of its complex cross-language and environment dependencies, MementoEmbed is installed via Docker. To run the latest build use the following commands.$ docker pull oduwsdl/mementoembed
$ docker run -d -p 5550:5550 oduwsdl/mementoembedMementoEmbed can now be accessed fromhttp://localhost:5550/.Installing and Running From Source Using DockerDownload the code and build an image as following:$ git clone https://github.com/oduwsdl/MementoEmbed.git
$ cd MementoEmbed
$ docker build -t mementoembed .Then run a container from this image:$ docker run -it --rm -p 5550:5550 mementoembedFlags-itand--rmwill make the container connect to the host TTY in interactive mode and remove the container once the process is killed or terminated.
To run the container in detached mode, run the following command instead:$ docker run -d -p 5550:5550 mementoembedIn either case, the application should be accessible athttp://localhost:5550/.Installing and Running LocallyDownload the code and install it within your Python environment.$ git clone https://github.com/oduwsdl/MementoEmbed.git
$ cd MementoEmbed
$ pip install .Then set it up to run locally using Flask.$ export FLASK_APP=mementoembed
$ flask runLoading a Desired ConfigurationThe configuration options for MementoEmbed are documented insample_appconfig.cfg.The defaults are stored inconfig/default.py.To use your own configuration file, copysample_appconfig.cfg, make modifications, and place it in/etc/mementoembed.cfg. Then run the application locally as described above.To use your own configuration file stored at/path/to/my/config.cfgwith a Docker image, use the-vDocker option:docker run -it --rm -v /path/to/my/config.cfg:/etc/mementoembed.cfg  -p 5550:5550 oduwsdl/mementoembedDirectory LayoutThe following directory structure exists for organizing MementoEmbed:/config/ - default Flask configuration for MementoEmbed/docs/ - source for documentation of MementoEmbed, products can be viewed at the projectDocumentation Page./githooks/ - hooks for use with Git in development (was an experiment, not currently used)/mementoembed/ - main MementoEmbed application/mementoembed/services/ - code containing source code for the machine-accessible MementoEmbed endpoints/mementoembed/static/ - JavaScript and CSS used for the MementoEmbed application/mementoembed/templates/ - Jinja2 templates for the MementoEmbed application/mementoembed/ui/ - code for the user interface MementoEmbed endpoints/tests/unit - automated unit tests for core MementoEmbed functionality/tests/integration - automated integration tests to run against a running MementoEmbed container.dockerignore - used to indicate which files Docker should ignore when building an image.gitignore - used to indicate which files Git should not commit during development.travis.yml - configuration for executing unit tests and testing build of MementoEmbedCONTRIBUTING.md - instructions for contributing to this projectDockerfile - used to build the docker imageLICENSE - the license for this projectMANIFEST.in - used to ensure additional files are installed on the system when pip is runREADME.md - this filedockerstart.sh - the script run by Docker to start MementoEmbed once a container is startedpackage-lock.json - pakcage version information used by npm for thumbnail generationraiseversion.sh - a script run to raise the version of MementoEmbed in both documentation and source coderequirements.txt - listing of requirements used in the Docker container's Python environmentrelease.sh - script planned for use when releasing MementoEmbed (not currently used, may be removed at some point)sample_appconfig.cfg - MementoEmbed configuration used by the Docker containersetup.py - standard Python installation configuration fileRun unit testsThe unit tests are designed to be easily run from the setup.py file.$ pip install .
$ python ./setup.py testRun integration testsWith a fully operational MementoEmbed, integration tests are possible.python -m unittest discover -s tests/integrationIntegration tests, by default, assume that the instance to be tested is running at port 5550. This can be altered with theTESTPORTenvironment variable, like so:export TESTPORT=9000.Integration tests are heavily dependent on environmental factors such as the current state of web archive playback systems. The favicon detection appears to be especially unpredictable. Because of this, we recommend that integration tests be reviewed by humans and not executed automatically on build.ContributingPlease consult the Contribution Guidelines inCONTRIBUTING.mdfor submitting bug reports, pull requests, etc.