Add RSS plugin (#192)

This commit is contained in:
Simon Lecoq
2021-03-21 12:14:05 +01:00
committed by GitHub
parent 3df4159026
commit 30fb3b4a41
14 changed files with 234 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
/**Mocked data */
export default function({faker, url, options, login = faker.internet.userName()}) {
//Stackoverflow api
if (/^https:..example.org.rss$/.test(url)) {
console.debug(`metrics/compute/mocks > mocking rss feed result > ${url}`)
return ({
status:200,
data:{
items:new Array(30).fill(null).map(_ => ({
title:faker.lorem.sentence(),
link:faker.internet.url(),
content:faker.lorem.paragraphs(),
contentSnippet:faker.lorem.paragraph(),
isoDate:faker.date.recent(),
})),
title:faker.lorem.sentence(),
description:faker.lorem.paragraph(),
link:url,
},
})
}
}