{"id":13830434,"url":"https://github.com/Pejjo/MMM-News","last_synced_at":"2025-07-09T11:33:09.739Z","repository":{"id":191039460,"uuid":"165201664","full_name":"Pejjo/MMM-News","owner":"Pejjo","description":"MagicMirror module - displaying news articles with Newsapi.org API V2","archived":false,"fork":false,"pushed_at":"2018-10-17T15:03:55.000Z","size":2263,"stargazers_count":0,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T10:03:06.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pejjo.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}},"created_at":"2019-01-11T07:47:15.000Z","updated_at":"2023-08-28T17:51:25.000Z","dependencies_parsed_at":"2024-01-15T17:39:04.460Z","dependency_job_id":"8f4dba68-d6f7-4b56-b550-4ef28a3b9c74","html_url":"https://github.com/Pejjo/MMM-News","commit_stats":null,"previous_names":["pejjo/mmm-news"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pejjo%2FMMM-News","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pejjo%2FMMM-News/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pejjo%2FMMM-News/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pejjo%2FMMM-News/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pejjo","download_url":"https://codeload.github.com/Pejjo/MMM-News/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225539396,"owners_count":17485319,"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-08-04T10:00:59.851Z","updated_at":"2024-11-20T11:30:46.996Z","avatar_url":"https://github.com/Pejjo.png","language":"JavaScript","funding_links":[],"categories":["News"],"sub_categories":[],"readme":"# MMM-News\nMagicMirror module - displaying news articles with News.org API V2\n\n\n## Features\n- Aggregate headlines from multiple sources at once.\n- Country specific, Category specific, Keyword specific news could be aggregated.\n- Touchable (Clickable) UI supported\n- Can open article page in iFrame and scrollable by touch or autoScroll\n- Controllable by notification\n- Controllable by MMM-TelegramBot\n- Customizable with Template\n\n## Screenshot\n- `type:horizontal`, `touchable:true`\n![Screenshot](https://raw.githubusercontent.com/eouia/MMM-News/master/sc3.png)\n\n- `type:vertical`, `touchable:false`\n![Screenshot](https://raw.githubusercontent.com/eouia/MMM-News/master/sc4.png)\n\n- detail page is opened\n![Screenshot](https://raw.githubusercontent.com/eouia/MMM-News/master/sc5.png)\n\n- Control by Telegram\n![Screenshot](https://raw.githubusercontent.com/eouia/MMM-News/master/sc6.png)\n\n\n\n## Installation\n```javascript\ncd ~/MagicMirror/modules/\ngit clone https://github.com/eouia/MMM-News\n```\n\n## Get `newsapi.org` API Key\nhttps://newsapi.org/\n\n## Configuration\n### Simple\n```javascript\n{\n  module: \"MMM-News\",\n  position: \"bottom_bar\",\n  config: {\n    apiKey : \"YOUR NEWSAPI.ORG API KEY\",\n    type: \"horizontal\",\n    query : [\n      {\n        sources: \"abc-news, cnn, bild\",\n      },\n      {\n        country: \"de\",\n        className: \"redTitle\",\n      },\n      {\n        country: \"gb\",\n        category: \"sports\",\n        q : \"Manchester United\"\n      }\n    ],\n  }\n},\n```\n\n### Defaults and Details\n```javascript\n{\n  module: \"MMM-News\",\n  position: \"bottom_bar\",\n  config: {\n    apiKey : \"\", // set your newsapi.org API Key\n    type: \"horizontal\", // \"horizontal\", \"vertical\" You can make your own type with CSS class selector.\n\n    // See https://newsapi.org/sources for available query options('sources' or `country`, `category`).\n    query : [\n      {\n        sources: \"abc-news, bloomberg, cnn\",\n        // A comma-seperated string of identifiers for the news sources or blogs you want headlines from.\n        // Too many `sources` at once could make API error. If you want, split them to several queries.\n        // `sources` are not able to be mixed with `country` and `category`.\n      },\n      {\n        country: \"de\",\n        className: \"redTitle\", // You can give your CSS className for these articles.\n      },\n      {\n        country: \"gb\", // country : The 2-letter ISO 3166-1 code of the country, \"\" or `null` for all of the world.\n        category: \"sports\", // category : The category you want to get headlines for.\n        // Possible options: `business` `entertainment` `general` `health` `science` `sports` `technology`\n        q : \"Manchester United\", // Keywords or a phrase to search for. `null`, \"\", or omitted will get all headlines.\n      }\n    ],\n    items: 20, // number of how many headlines to get from each query. max 100\n    timeFormat: \"relative\", // Or You can use \"YYYY-MM-DD HH:mm:ss\" format.\n    drawInterval: 1000*30, // How long time each article will be shown.\n    autoScroll: false, // some site will not be displayed as normal when this is set as true. but normally, we have no interface to control the scroll of MM. Choice is yours.\n    scrollStep: 100,\n    scrollInterval: 1000,\n    touchable: true, // When you have a touchable or clickable interface on your MM.\n    detailTimeout : 1000*20, //Hide detail when this time passed after last action. `0` : never be timed out.\n    telegramBotOrderOpenDetail : false, //When you use telegramBot, you might not need open detail iFrame on Mirror, because you can get detail link on Telegram.\n\n    // You might not need modify belows;\n    endpoint :  \"https://newsapi.org/v2/top-headlines\",\n    scanInterval: 1000*60*10, // This will be automatically recalculated by number of queries to avoid query quota limit. This could be minimum interval.\n    templateFile: \"template.html\",\n    notifications: {\n      previousArticle : \"NEWS_PREVIOUS\",\n      nextArticle : \"NEWS_NEXT\",\n      showDetail : \"NEWS_DETAIL\",\n      closeDetail : \"NEWS_DETAIL_CLOSE\",\n      scrollDownDetail : \"NEWS_DETAIL_SCROLLDOWN\",\n      scrollUpDetail : \"NEWS_DETAIL_SCROLLUP\"\n    },\n  }\n},\n\n```\n\n## Template\nYou can redesign output with `template.html`. Default is this;\n```html\n\u003cdiv class=\"article %CLASSNAME%\" id=\"%ARTICLEID%\"\u003e\n  \u003cdiv class=\"header\"\u003e\n    \u003cdiv class=\"title\"\u003e%TITLE%\u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"content\"\u003e\n    \u003c!-- \u003cimg src=\"%URLTOIMAGE%\"/\u003e --\u003e\n    %ARTICLEIMAGE%\n    %DESCRIPTION%\n  \u003c/div\u003e\n  \u003cdiv class=\"footer\"\u003e\n    \u003cdiv class=\"sourceName\" id=\"%SOURCEID%\"\u003e%SOURCENAME%\u003c/div\u003e\n    \u003cdiv class=\"publishedAt\"\u003e - %PUBLISHEDAT%\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n### Available Template Tags\n\n|Tag | Example | Description |\n|---|---|---|\n|%SOURCEID% | `cnn` or `N-tv-de` | Unique `id` of each news site. |\n|%SOURCENAME%| `cnn.com` or `N-tv.de` | `name` of each news site. |\n|%AUTHOR% | `John Doe` | Author of this article. |\n|%TITLE%| `Who Framed Roger Rabbit` | Title of this article. |\n|%DESCRIPTION%| `blah blah blah...` | Short description of this article (not article itself). |\n|%CONTENT%| `blah blah blah...` | Full or Shorten news articles. it may differ by each news site. |\n|%ARTICLEID%| `X12345678` | Unique `id` of each news article. |\n|%PUBLISHEDAT%| `2 hours ago` or `2018-10-01 12:34:56` | Published time. |\n|%URL%| `http://cnn.com/...` | URL of original news article. |\n|%URLTOIMAGE% |`http://image.cnn.com/...` | URL of image. (if exists)|\n|%ARTICLEIMAGE%| `\u003cimg src=\"http://image.cnn.com/...\"... \u003e` | Ready-made image tag. |\n|%CLASSNAME%| `someClassName` | When you give `className` to `query`, that value will be used as this. |\n\n\n## `MMM-TelegramBot` commands\n|command | Description |\n|---|---|\n|`/news`| Send current news link to Telegram.|\n|`/news n`| Next article |\n|`/news p`| Previous article |\n|`/news c`| Close detail iframe page |\n|`/news u`| Scroll Up detail iframe page |\n|`/news d`| Scroll Down detail iframe page |\n\n## Notification commands\n|notification | Description |\n|---|---|\n|`NEWS_NEXT`| Next article |\n|`NEWS_PREVIOUS`| Previous article |\n|`NEWS_DETAIL`| Open detail iframe page of current news|\n|`NEWS_DETAIL_CLOSE`| Close detail iframe page |\n|`NEWS_DETAIL_SCROLLUP`| Scroll Up detail iframe page |\n|`NEWS_DETAIL_SCROLLDOWN`| Scroll Down detail iframe page |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPejjo%2FMMM-News","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPejjo%2FMMM-News","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPejjo%2FMMM-News/lists"}