A service that provides archive-aware oEmbed-compatible embeddable surrogates (social cards, thumbnails, etc.) for archived web pages (mementos).
Clone or download
Permalink
Failed to load latest commit information.
bin restructured the app based on the Flask tutorial, cleaned up unused code May 28, 2018
config fixes #139, now SVG favicons can be converted into data URIs Oct 22, 2018
docs fixes #140, now corrupt original resource favicons generate blank dat… Oct 22, 2018
githooks adding pre-commit script to githooks Jul 16, 2018
mementoembed fixes #140, now corrupt original resource favicons generate blank dat… Oct 22, 2018
tests fixes for link header problems identified in #136 Oct 11, 2018
.dockerignore fixes #105, Dockerfile now installs with Python 3.7 Aug 17, 2018
.gitignore fixes #140, now corrupt original resource favicons generate blank dat… Oct 22, 2018
.travis.yml implementing Travis CI solution for Python 3.7 described in travis-ci… Aug 17, 2018
CONTRIBUTING.md Update CONTRIBUTING.md Jun 14, 2018
Dockerfile fixes #107, pipenv is now used for MementoEmbed Aug 19, 2018
LICENSE Create LICENSE Jun 9, 2018
MANIFEST.in Rename manifest file to uppercase for strict loading requirement, fix #… Jul 3, 2018
Pipfile fixes #139, now SVG favicons can be converted into data URIs Oct 22, 2018
Pipfile.lock fixes #139, now SVG favicons can be converted into data URIs Oct 22, 2018
README.md Updating README.md to describe the use of a custom configuration Oct 12, 2018
dockerstart.sh fixes for waitress deployment issue that turned out to be a setup.py … Jul 16, 2018
example.png a very rudimentary thumbnail service, work for #10 Jul 16, 2018
package-lock.json saving work done on HTML-only cards so far Aug 29, 2018
raiseversion.sh raising the version Jul 25, 2018
release.sh now we've moved to calendar versioning, thanks @ibnesayeed for the su… Jul 13, 2018
sample_appconfig.cfg improvements for configuration file defaults and also defaults for th… Oct 12, 2018
setup.py fixes for waitress deployment issue that turned out to be a setup.py … Jul 16, 2018

README.md

Build Status Doc Status

MementoEmbed

Image of a Social Card

A tool to create archive-aware oEmbed-compatible embeddable surrogates for archived web pages (mementos). The system currently creates social cards like the one shown above and thumbnails like the one shown below. 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.

Image of a Social Card

For more information on this application, please visit our Documentation Page.

Installation and Execution

Installing and Running the Latest Build Using Docker

Because 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/mementoembed

MementoEmbed can now be accessed from http://localhost:5550/.

Installing and Running From Source Using Docker

Download 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 mementoembed

Flags -it and --rm will 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 mementoembed

In either case, the application should be accessible at http://localhost:5550/.

Installing and Running Locally

Download 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 run

Loading a Desired Configuration

The configuration options for MementoEmbed are documented in sample_appconfig.cfg.

The defaults are stored in config/default.py.

To use your own configuration file, copy sample_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.cfg with a Docker image, use the -v Docker option: docker run -it --rm -v /path/to/my/config.cfg:/etc/mementoembed.cfg -p 5550:5550 oduwsdl/mementoembed

Directory Layout

The following directory structure exists for organizing MementoEmbed:

  • /bin/ - scripts using MementoEmbed libraries (was used for early development, to be removed at some future point)
  • /config/ - default Flask configuration for MementoEmbed
  • /docs/ - source for documentation of MementoEmbed, products can be viewed at the project Documentation Page.
  • /githooks/ - hooks for use with Git in development (was an experiment, not currently used)
  • /instance/ - default Flask configuration for MementoEmbed
  • /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/ - automated unit tests for core MementoEmbed functionality
  • .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 MementoEmbed
  • CONTRIBUTING.md - instructions for contributing to this project
  • Dockerfile - used to build the docker image
  • LICENSE - the license for this project
  • MANIFEST.in - used to ensure additional files are installed on the system when pip is run
  • Pipfile - package information used by pipenv
  • Pipfile.lock - package version information used by pipenv
  • README.md - this file
  • dockerstart.sh - the script run by Docker to start MementoEmbed once a container is started
  • package-lock.json - pakcage version information used by npm
  • raiseversion.sh - a script run to raise the version of MementoEmbed in both documentation and source code
  • release.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 container
  • setup.py - standard Python installation configuration file

Run unit tests

The unit tests are designed to be easily run from the setup.py file.

$ pip install .
$ python ./setup.py test

Contributing

Please consult the Contribution Guidelines in CONTRIBUTING.md for submitting bug reports, pull requests, etc.