Skip to content

Instantly share code, notes, and snippets.

@lilywang711
Last active November 4, 2020 10:17
Show Gist options
  • Save lilywang711/fc06b13712e932b483bda86eb093d55b to your computer and use it in GitHub Desktop.
Save lilywang711/fc06b13712e932b483bda86eb093d55b to your computer and use it in GitHub Desktop.
生成 NEI 上所有已选择接口的交付格式
function queryAllSelectedAPI() {
const selectedList = document.querySelectorAll('.list-bd .list-group-wrap .list-row.js-selected');
return Array.from({ length: selectedList.length }).map((_, index) => {
const node = selectedList[index]
const title = node.querySelector('div.list-col.col-name > a').innerText
const link = node.querySelector('div.list-col.col-name > a').getAttribute('href')
const name = node.querySelector('div.list-col.col-creator-realname').innerText
return `${index+1}、 ${title}(${name}): ${location.origin}${link}`
}).join('\n')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment