File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from funcs .replit_scrapper import ReplitScrapper
2+ from funcs .github_archiver import GithubArchiver
3+ import os
4+ import zipfile
5+ from dotenv import load_dotenv
6+ load_dotenv ()
7+
8+ WDIR = os .path .abspath (os .path .dirname (__name__ ))
9+
10+ if __name__ == "__main__" :
11+ test_url = "https://replit.com/@pythondojoarchi/SlipperyGargantuanDebuggers"
12+ project_name = "SlipperyGargantuanDebuggers"
13+
14+ # Download repo files as zip
15+ scrapper = ReplitScrapper (login_name = os .environ ['EMAIL' ], login_password = os .environ ['PASSWORD' ])
16+ scrapper .set_replit_url (test_url )
17+ scrapper .run ()
18+
19+ # Unzip downloaded zip file
20+ download_folder_path = os .path .join (WDIR , "screen-shots" )
21+ full_file_path = os .path .join (download_folder_path , project_name + ".zip" )
22+ extracted_folder_path = os .path .join (download_folder_path , project_name )
23+ zipfile .ZipFile (full_file_path ).extractall (extracted_folder_path )
24+
25+ # Commit target files to Github
26+ archiver = GithubArchiver (
27+ project_name = project_name ,
28+ github_access_token = os .environ ['GITHUB_ACCESS_TOKEN' ]
29+ )
30+ archiver .identify_target_files ()
31+ archiver .commit_to_github ()
You can’t perform that action at this time.
0 commit comments