{"id":18615787,"url":"https://github.com/eppfel/mimr","last_synced_at":"2025-11-03T04:30:38.575Z","repository":{"id":80136043,"uuid":"80315310","full_name":"eppfel/mimr","owner":"eppfel","description":"NodeJS script to track and mail changes of specific elements on a web-site using CSS selectors","archived":false,"fork":false,"pushed_at":"2017-03-29T13:19:20.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T03:12:39.409Z","etag":null,"topics":["changes","extract","mailer","module","nodejs-script","observer","track","web"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eppfel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-28T22:33:49.000Z","updated_at":"2017-01-30T17:24:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c03bb58-b991-485a-a17b-47a066f70e1f","html_url":"https://github.com/eppfel/mimr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eppfel%2Fmimr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eppfel%2Fmimr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eppfel%2Fmimr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eppfel%2Fmimr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eppfel","download_url":"https://codeload.github.com/eppfel/mimr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412301,"owners_count":19634010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["changes","extract","mailer","module","nodejs-script","observer","track","web"],"created_at":"2024-11-07T03:32:49.691Z","updated_at":"2025-11-03T04:30:38.508Z","avatar_url":"https://github.com/eppfel.png","language":"JavaScript","readme":"# Mímr\nMímr (_[from the norse god Mímir](https://en.wikipedia.org/wiki/M%C3%ADmir)_) is a NodeJS script to track and mail changes of specific elements on a web-site using CSS selectors.\n\n## Installation\n\nThis script requires `node`\u003e= 6, `npm` and [`yarn`(secure npm alternative)](https://yarnpkg.com/). You have to clone this repository, because the package is not yet available in the npm registry.\n\n```bash\n$ git clone https://github.com/eppfel/mimr.git\n```\n\nInside the folder you install all dependecies with:\n\n```bash\n$ yarn install\n```\n\n## Usage\n\n### Run with `Node`\n\nYou can execute this script directly with node by calling `index.js` :\n\n```bash\n$ node index.js\n```\n\nAll results will be stored in `store.json`, so, if you call the script again, it will only show you new findings.\n\nBut first you need to configure a config file:\n\n#### Configuration in `config.json`\n\nThe script tracks page elements specified in the `config.json` in the `pages` array:\n```JSON\n{\n  \"pages\": [{\n    \"name\": \"Github Trending Repositories\",\n    \"url\": \"https://github.com/trending\",\n    \"selector\": \".explore-content h3 a\"\n  }]\n}\n```\n\nEach page needs the following parameters:\n\nParameter | Value\n----------|------\nname      | a name for each page (completely free)\nurl       | an url to an html page to be tracked\nselector  | a CSS selector to retrieve a set of elements from the page\n\nAdditionally you can specifiy mail credentials to send the results via mail. Just leave the mail setting, if you do not want to use it.\n\n```JSON\n{\n  \"mail\": {\n    \"host\": \"smtp.example.org\",\n    \"username\": \"mail@example.org\",\n    \"password\": \"***\",\n    \"from\": \"mail@example.org\",\n    \"to\": \"mail@example.org\"\n\t}\n}\n```\nMimir uses [nodemailer](https://github.com/nodemailer/nodemailer). See their [documentation](https://community.nodemailer.com/) for more details on the parameters.\n\n##### You'll find an example configuration in `config.example.json`.\n\n### Use as module\n\nInclude it in your projects folder or in your `node_modules` folder to import it via `require()`.\n\n```JS\nconst mimr = require('./mimr')\n\nconst pages = [{\"name\": \"Github Trending Repositories\", \"url\": \"https://github.com/trending\", \"selector\": \".explore-content h3 a\"}]\nconst oldFindings = []\n\nmimr(pages, oldFindings).then(([err, newFindings, allFindings]) =\u003e {\n  for (let page of newFindings) {\n    console.log(page.finds)\n  }\n}).catch(console.error)\n```\n\n`mimr` takes an array with pages to track (see configuration) and optionally findings from a previous run to compare against.\n\nIt returns a promise that resolves an array with three elements:\n- `err`: If some errors occur during extraction this will not directly break execution\n- `allFindings`: These are all findings for each page provided, with an added attribute `finds`, which as an array of Strings or Objects with of found elements.\n- `newFindings`: These are the findings for each page provided as `allFindings` minus the elements provided by `oldFindings`.\n\n## Roadmap\n\n* Impliment this as a service with internal scheduling to support features like a results web server or RSS Feed\n* More comprehensive results with\n    - extracting any HTML attributes\n    - define custom templates for your findings\n* Tests\n* Browserify – to use from directly in the browser or a browser extension\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feppfel%2Fmimr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feppfel%2Fmimr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feppfel%2Fmimr/lists"}