{"id":20768132,"url":"https://github.com/softwaremill/scalatimes","last_synced_at":"2025-04-30T11:22:58.504Z","repository":{"id":13284081,"uuid":"15969851","full_name":"softwaremill/scalatimes","owner":"softwaremill","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-08T01:36:33.000Z","size":4248,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-03-30T15:46:59.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"scalatimes.com","language":"Pug","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softwaremill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-01-16T14:19:07.000Z","updated_at":"2025-02-13T07:15:47.000Z","dependencies_parsed_at":"2024-01-04T11:31:59.794Z","dependency_job_id":"fcbdef35-9a35-46ac-b7d8-491fbab7f03b","html_url":"https://github.com/softwaremill/scalatimes","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fscalatimes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fscalatimes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fscalatimes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fscalatimes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwaremill","download_url":"https://codeload.github.com/softwaremill/scalatimes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251689114,"owners_count":21627843,"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":[],"created_at":"2024-11-17T11:35:50.423Z","updated_at":"2025-04-30T11:22:58.469Z","avatar_url":"https://github.com/softwaremill.png","language":"Pug","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Newsletters Archive via Mailchimp API\n\nYou can see example on [Scala Times](http://www.scalatimes.com/) - Weekly Scala Newspaper.\n\n## Overview\n\nThis app is built on the top of [MailChimp API v3.0 NodeJs Example Application](https://mailchimp.com/developer/marketing/api/lists/).\n\n### Analytics\n\nHere is [the link](https://analytics.google.com/analytics/web/#report/defaultid/a11235106w117557468p123015903/) where you can check GA for the site.\n\n### TeamCity CI\n\nContinuous Integration for the site is [here](https://teamcity.internal.sml.io/project.html?projectId=ScalatimesCom\u0026tab=projectOverview).\n\n## Running project for the first time\n\n### NodeJS\n\nInstall [Node.js](http://nodejs.org/) or check, if you have it installed.\nTo check, if it's installed, run command `node -v` in console.\nIf you see version - than you have it installed.\n\nIf not - go to [http://nodejs.org/](nodejs.org) and install it from there.\n\n### Install dependencies\n\nIn console navigate to project's folder and run\n\n```\n  npm install\n```\n\nThis will install all required dependencies for this project (Express, Pug, Mailchimp API, Cheerio, Underscore).\n\n### Run app\n\n#### Mailchimp setup\n\nNavigate to `routes/archive.js` file and update Mailchimp API key and List ID.\nYou need a Mailchimp API key and List ID. If you have a user account connected to the SoftwareMill account, use following\ninstructions to retrieve this data:  \n[Here](http://kb.mailchimp.com/accounts/management/about-api-keys) you can find information on how to find your Mailchimp API key.\n[Here](http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id) you can find information on how to find List ID.\n\n#### Amazon CloudSearch setup\n\nThe application allows users to search links based on some text. It does so by using AWS Cloud Search underneath. In order\nfor this to work you must have AWS account with\n[Search Domain created there](https://docs.aws.amazon.com/cloudsearch/latest/developerguide/creating-domains.html).\nEach Search Domain is given unique endpoint that can be used to issue search queries.\n[More details here](https://docs.aws.amazon.com/cloudsearch/latest/developerguide/search-api.html).\n\nExample value of `AWS_CS_QUERY_URL` =\n`http://search-movies-rr2f34ofg56xneuemujamut52i.us-east-1.cloudsearch.amazonaws.com/2013-01-01/search`\n\nCurrent implementation of search sorts results based on custom expression named `custom_score`. This Expression is defined\nas `_score*(1-min(0.1*(_time-date)/31556926000,0.5))`. So for a 1 year old link we decrease build-in `_score` by 10%,\nfor 2 years old by 20%, and so on. At most we reduce the original `_score` by 50% so it doesn't matter if link is 5 years\nold or 7 years old. Expressions can be easily managed through CloudSearch Dashboard.\n\n#### When you are all set up\n\nAfter all configuration is done just run:\n\n```\n  CACHE_PATH=/tmp MAILCHIMP_API_KEY={YOUR_API_KEY} MAILCHIMP_LIST_ID={YOUR_LIST_ID} AWS_CS_QUERY_URL={AWS_CS_URL}  node app.js\n```\n\nor for Windows run like this\n\n```\n  $env:CACHE_PATH=\"{some path}\"\n  $env:MAILCHIMP_API_KEY=\"{key}\"\n  $env:MAILCHIMP_LIST_ID=\"{list_id}\"\n  $env:AWS_CS_QUERY_URL=\"{aws_cloud_serach_url}\"\n\n  node app.js\n```\n\nWait couple of seconds, while you see\n\n```\n  campaignsCache is ready\n```\n\nin console.\n\nNovigate to `http://localhost:3000/` in your browser.\n\nYou should have the latest issue on index page, and archive (last 100 issues) on `http://localhost:3000/archive` page.\n\n### Live deployment\n\nThe production deployment exposed on https://scalatimes.com is automatically deployed from the `master` branch.\n\n### Disk cache\n\nThe app tries to load campaigns from local cache directory specified by `CACHE_PATH`. This directory can be purged to force reload from MailChimp API.\n\n### Fix archive page\n\nTo make your archive page properly show excerpts of every newsletter, you need to update function `getCampaignExcerpts()` in `routes/archive.js`.\nThis function gets HTML of every campaign and finds important information in that HTML.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Fscalatimes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwaremill%2Fscalatimes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Fscalatimes/lists"}