URLSync is a Python script designed to continuously check a specified document accessible via URL for updates and save its contents locally. This script is useful for scenarios where real-time synchronization between an online document and a local file is required.
- Automatically retrieves content from a document using its URL.
- Monitors changes in the document and updates the local file accordingly.
- Customizable start and end markers to specify the portion of the document to synchronize.
- Error handling for network issues and document parsing errors.
- Simple and easy-to-understand Python script.
- Clone or download this repository to your local machine.
- Install the required Python packages using
pip install requests
. - Modify the script variables to specify your document URL, local file name, and synchronization interval.
- You can change the document URL to any link you want, not limited to Google documents.
- Run the script using
python Web-Content-Sync.py
. - The script will continuously monitor the document for updates and save its contents locally.
To run the script in the background without a terminal window, you can use the provided "Run-without-terminal.vbs" file. This VBScript file launches the Python script invisibly.
- Ensure both the Python script (Web-Content-Sync.py) and the Run-without-terminal.vbs file are in the same directory.
- Double-click the Run-without-terminal.vbs file to execute it.
- The script will run in the background, continuously monitoring the specified document.
url
: URL of the document to synchronize.file
: Name of the local file to save the synchronized content.start
andend
: Markers to specify the portion of the document to synchronize.refresh
: Interval (in seconds) to wait between synchronization attempts.error
: Interval (in seconds) to wait before retrying after encountering an error.
- requests: HTTP library for making requests and handling responses.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.