ListProjects - gitcode.net

2023/11/17 14:57:11

اعتبارا من 17-11-2023. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        ListProjects - gitcode.net
// @namespace   Violentmonkey Scripts
// @match       https://gitcode.net/users/u011405698/projects
// @grant       none
// @version     2311171534
// @author      alvin
// @license     MIT
// @description 2023/11/17 14:57:11
// ==/UserScript==

 function data_to_csv(data, name) {
            const blob = new Blob(data, {type: 'text/csv,charset=UTF-8'});
            const uri = URL.createObjectURL(blob);
            let downloadLink = document.createElement('a');
            downloadLink.href = uri;
            downloadLink.download = (name+".csv")||"temp.csv";
            document.body.appendChild(downloadLink);
            downloadLink.click();
            document.body.removeChild(downloadLink);
}


window.onload= function(){
projects = document.querySelectorAll("li.project-row")
//保存数据,注意换行格式
 var data_list=Array();
  data_list.push(["标题","链接","\n"]);
 projects.forEach(project=>{
  href =project.querySelector('.project').href
  description = project.querySelector('.description').innerHTML

  data_list.push([ href,description ]);
  console.log(href)
  console.log(description)

})
 data_to_csv(data_list, "projects.csv");



}