{"id":24033978,"url":"https://github.com/alabr0s/copilotscrape","last_synced_at":"2026-05-01T20:33:05.848Z","repository":{"id":262830727,"uuid":"888490771","full_name":"Alabr0s/copilotscrape","owner":"Alabr0s","description":"Free Copilot Gpt AI Scrape api","archived":false,"fork":false,"pushed_at":"2024-11-14T15:41:01.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T05:33:13.226Z","etag":null,"topics":["ai","api","copilot","flask","gemini","gpt-3","gpt-4","gpt-4o","python","scraper","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alabr0s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T13:45:07.000Z","updated_at":"2025-01-11T23:55:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"77771f8e-688f-4edd-8f98-e56400e04b98","html_url":"https://github.com/Alabr0s/copilotscrape","commit_stats":null,"previous_names":["alabr0s/copilotscrape"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Alabr0s/copilotscrape","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alabr0s%2Fcopilotscrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alabr0s%2Fcopilotscrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alabr0s%2Fcopilotscrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alabr0s%2Fcopilotscrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alabr0s","download_url":"https://codeload.github.com/Alabr0s/copilotscrape/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alabr0s%2Fcopilotscrape/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","copilot","flask","gemini","gpt-3","gpt-4","gpt-4o","python","scraper","selenium"],"created_at":"2025-01-08T18:57:02.864Z","updated_at":"2026-05-01T20:33:05.821Z","avatar_url":"https://github.com/Alabr0s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Web Scraping \u0026 AI Interaction with Flask API\n\nThis project is a web scraping and AI interaction system that integrates with a Microsoft Copilot-like platform using Selenium, Flask, and various utilities. It fetches messages from an AI platform, processes the data, and serves it via a Flask API.\n\n---\n\n## Özellikler\n\n- **Web Scraping**: Selenium ile, bir web sitesinden AI mesajlarını çekme ve bunları işleme.\n- **Mesaj İşleme**: AI tarafından gönderilen mesajlarda ön ek (prefix) temizleme ve özel kelime değişiklikleri yapma.\n- **Resim Tespiti**: AI mesajlarındaki resim bağlantılarını kontrol etme.\n- **Kod Blokları**: AI mesajlarından kod bloklarını çıkarma.\n- **Flask API**: Web üzerinden yapılan istekleri işleyerek yanıtlar sağlama.\n- **Cookies ve LocalStorage Kaydetme**: Tarayıcıda oturum bilgilerini kaydetme ve tekrar yükleme.\n- **API Anahtarı Doğrulaması**: Güvenlik amacıyla API anahtarları ile doğrulama.\n\n---\n\n## Kurulum\n\n### Gereksinimler\n\n- Python 3.x\n- Selenium\n- Flask\n- ChromeDriver\n- Google Chrome\n- API Anahtarları ve **settings.json** dosyası\n\n### Adımlar\n\n1. **Python Bağımlılıklarını Yükleyin**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. **ChromeDriver ve Google Chrome**: \n   Tarayıcı sürümünüze uygun ChromeDriver'ı [buradan](https://sites.google.com/a/chromium.org/chromedriver/) indirip projenizin kök dizinine yerleştirin.\n\n3. **settings.json**:\n   `settings.json` dosyasını aşağıdaki örneğe göre yapılandırın:\n\n   ```json\n   {\n     \"driver\": {\n       \"chrome_driver_path\": \"path/to/chromedriver\",\n       \"user_agent\": \"your_user_agent\"\n     },\n     \"api\": {\n       \"keys_file\": \"keys.txt\",\n       \"response_messages\": {\n         \"ai_message\": \"ai_message\",\n         \"code_blocks\": \"code_blocks\",\n         \"img_link\": \"img_link\"\n       }\n     },\n     \"cookies_path\": \"cookies.pkl\",\n     \"localstorage_path\": \"localstorage.pkl\",\n     \"log_messages\": {\n       \"login_prompt\": \"Please log in.\",\n       \"error_occurred\": \"An error occurred\",\n       \"server_started\": \"Server started successfully\"\n     },\n     \"xpath_code_blocks\": \"//pre[@class='code-block']\",\n     \"xpath_user_input\": \"//textarea[@id='input']\",\n     \"xpath_ai_message\": \"//div[@class='ai-message']\",\n     \"xpath_img_container\": \"//div[@class='img-container']\",\n     \"img_link_check_timeout\": 10\n   }\n   ```\n\n4. **API Anahtarları**:\n   `keys.txt` dosyasına, API anahtarlarınızı her satıra bir anahtar olacak şekilde ekleyin.\n\n5. **Flask Sunucusunu Başlatın**:\n   Projeyi başlatmak için:\n   ```bash\n   python app.py\n   ```\n\n---\n\n## API Kullanımı\n\n### Endpoint\n\n`GET /api`\n\n### Parametreler\n\n- **yazi**: AI'ya gönderilecek yazı.\n- **key**: API anahtarınız.\n\n### Örnek İstek\n\n```bash\ncurl \"http://localhost:5000/api?yazi=Merhaba\u0026key=your_api_key\"\n```\n\n### Yanıt Örneği\n\n```json\n{\n  \"ai_message\": \"Hello, how can I help you?\",\n  \"code_blocks\": \"def example(): pass\",\n  \"img_link\": \"https://example.com/image.jpg\"\n}\n```\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## Features\n\n- **Web Scraping**: Fetch and process AI messages from a website using Selenium.\n- **Message Processing**: Clean up prefixes and replace specific words in AI-generated messages.\n- **Image Detection**: Check for image links in AI messages.\n- **Code Block Extraction**: Extract code blocks from AI responses.\n- **Flask API**: Serve requests over a Flask API.\n- **Cookies and LocalStorage**: Save and load session information in the browser.\n- **API Key Authentication**: Secure the API using API keys.\n\n---\n\n## Installation\n\n### Requirements\n\n- Python 3.x\n- Selenium\n- Flask\n- ChromeDriver\n- Google Chrome\n- API Keys and **settings.json** file\n\n### Steps\n\n1. **Install Python Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. **ChromeDriver and Google Chrome**: \n   Download the correct version of ChromeDriver from [here](https://sites.google.com/a/chromium.org/chromedriver/) and place it in the root directory of your project.\n\n3. **settings.json**:\n   Configure your `settings.json` file as shown below:\n\n   ```json\n   {\n     \"driver\": {\n       \"chrome_driver_path\": \"path/to/chromedriver\",\n       \"user_agent\": \"your_user_agent\"\n     },\n     \"api\": {\n       \"keys_file\": \"keys.txt\",\n       \"response_messages\": {\n         \"ai_message\": \"ai_message\",\n         \"code_blocks\": \"code_blocks\",\n         \"img_link\": \"img_link\"\n       }\n     },\n     \"cookies_path\": \"cookies.pkl\",\n     \"localstorage_path\": \"localstorage.pkl\",\n     \"log_messages\": {\n       \"login_prompt\": \"Please log in.\",\n       \"error_occurred\": \"An error occurred\",\n       \"server_started\": \"Server started successfully\"\n     },\n     \"xpath_code_blocks\": \"//pre[@class='code-block']\",\n     \"xpath_user_input\": \"//textarea[@id='input']\",\n     \"xpath_ai_message\": \"//div[@class='ai-message']\",\n     \"xpath_img_container\": \"//div[@class='img-container']\",\n     \"img_link_check_timeout\": 10\n   }\n   ```\n\n4. **API Keys**:\n   Add your API keys to `keys.txt`, one key per line.\n\n5. **Start the Flask Server**:\n   To run the project:\n   ```bash\n   python app.py\n   ```\n\n---\n\n## API Usage\n\nYou can use the API like this:\n\n### Endpoint\n\n`GET /api`\n\n### Parameters\n\n- **yazi**: The text to send to the AI.\n- **key**: Your API key.\n\n### Example Request\n\n```bash\ncurl \"http://localhost:5000/api?yazi=Hello\u0026key=your_api_key\"\n```\n\n### Example Response\n\n```json\n{\n  \"ai_message\": \"Hello, how can I help you?\",\n  \"code_blocks\": \"def example(): pass\",\n  \"img_link\": \"https://example.com/image.jpg\"\n}\n```\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falabr0s%2Fcopilotscrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falabr0s%2Fcopilotscrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falabr0s%2Fcopilotscrape/lists"}