diff --git a/scrape_kpgpmc.swift b/scrape_kpgpmc.swift index 05ca82c..6686cb8 100644 --- a/scrape_kpgpmc.swift +++ b/scrape_kpgpmc.swift @@ -4,6 +4,12 @@ import Foundation let gitea = URL(string: "https://git.kpgpmc.org/explore/repos")! var request = URLRequest(url: gitea) request.httpMethod = "GET" + +if CommandLine.arguments.count > 1, + let cookiestring = String?(CommandLine.arguments[1]) { + request.setValue("i_like_gitea=\(cookiestring)", forHTTPHeaderField: "Cookie") +} + let semaphore = DispatchSemaphore(value: 0) let search_string = "tw-text-primary name" let hrefRegex = #/href="([^"]+)"/#