{"id":20144211,"url":"https://github.com/quansitech/qscmf-rssfeed","last_synced_at":"2026-05-13T04:02:31.414Z","repository":{"id":62531990,"uuid":"254597843","full_name":"quansitech/qscmf-rssfeed","owner":"quansitech","description":"rssfeed","archived":false,"fork":false,"pushed_at":"2020-04-10T11:30:15.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T10:50:11.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/quansitech.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}},"created_at":"2020-04-10T09:38:57.000Z","updated_at":"2020-04-10T11:29:50.000Z","dependencies_parsed_at":"2022-11-02T14:45:33.067Z","dependency_job_id":null,"html_url":"https://github.com/quansitech/qscmf-rssfeed","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Fqscmf-rssfeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Fqscmf-rssfeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Fqscmf-rssfeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Fqscmf-rssfeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quansitech","download_url":"https://codeload.github.com/quansitech/qscmf-rssfeed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241587914,"owners_count":19986627,"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-13T22:09:15.520Z","updated_at":"2026-05-13T04:02:31.327Z","avatar_url":"https://github.com/quansitech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rssfeed\n\n## 安装\n```php\ncomposer require quansitech/qscmf-rssfeed\n```\n\n## 用法\n配置PackageConfig.php(位于qscmf根目录，没有可以自行创建)\n```php\n//添加\n'quansitech/qscmf-rssfeed' =\u003e [\n    'feeds' =\u003e [\n        'title' =\u003e '这是我的rss',  //订阅标题\n        'items' =\u003e [  //被定于的数据库源\n            '新闻' =\u003e [\n                'model' =\u003e \\Common\\Model\\NewsModel::class\n            ],\n            '活动' =\u003e [\n                'model' =\u003e \\Common\\Model\\TribuneModel::class\n            ]\n        ]\n    ]\n]\n```\n\nmodel实现 Qsrssfeed\\Rssfeed 接口\n```php\n//以NewsModel为例\npublic function toFeedItem()\n{\n    //定义rss字段与数据源的字段映射\n    return [\n        'id' =\u003e 'id',  //必填\n        'title' =\u003e 'title', //必填\n        'summary' =\u003e 'content', \n        'updated' =\u003e 'publish_date', //必填\n        'link' =\u003e 'link',\n        'author' =\u003e 'author'\n    ];\n}\n\n//这里定义取得数据条目，这里只取最新的50条\npublic function getFeedItems()\n{\n    $ents = $this-\u003ewhere(['status' =\u003e DBCont::NORMAL_STATUS])-\u003eorder('publish_date desc')-\u003epage(1, 50)-\u003eselect();\n    foreach($ents as \u0026$ent){\n        $ent['link'] = U('/home/activities/detail', ['id' =\u003e $ent['id']], false, true);\n    }\n    return $ents;\n}\n```\n\n最后可以通过 http://域名/rss 就可以访问到生成的rss脚本\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansitech%2Fqscmf-rssfeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquansitech%2Fqscmf-rssfeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansitech%2Fqscmf-rssfeed/lists"}