summaryrefslogblamecommitdiff
path: root/examples/useragents/opera.js
blob: 56e192ca05e5154d4267a707a744e4e75bea177b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                        

export const config = {
  urls: range("https://blogs.opera.com/desktop/changelog-for-{}/", 60, 110),
};

export default function ({ doc, absoluteURL }) {
  const versions = doc.find(".content h4");
  return versions.map(versions => {
    return versions.text().split(" ")[0].trim();
  }).filter(Boolean);
}

function range(url, from, to) {
  return Array.from({length: to - from + 1}).map((_, i) => url.replace("{}", i + from));
}