|
|
||
|---|---|---|
| link_tracker.db | ||
| main.py | ||
| readme.md | ||
| requirements.txt | ||
readme.md
Link Tracker API
A simple web service that tracks links to your client websites and provides reports for SEO indexing services.
What This Does
This tool helps you:
- Track which pages link to your client websites
- Generate lists of URLs to submit to indexing services like colinkiri
- Keep track of which URLs you've already submitted
Installation
Step 1: Install Python
On Mac:
- Open Terminal (press
Cmd + Space, type "Terminal", press Enter) - Install Homebrew if you don't have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install Python:
brew install python
On Windows:
- Go to https://python.org/downloads/
- Download the latest Python version
- Run the installer
- Important: Check "Add Python to PATH" during installation
- Open Command Prompt (press
Win + R, type "cmd", press Enter)
Step 2: Download the Project
- Open Terminal (Mac) or Command Prompt (Windows)
- Navigate to where you want to install the project:
cd Desktop - Clone the project from GitHub:
git clone https://git.peninsulaindustries.com/bryanb/Link-Tracker-Server.git cd link-tracker
Step 3: Install Required Packages
On Mac (Terminal):
cd ~/Desktop/link-tracker
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
On Windows (Command Prompt):
cd %USERPROFILE%\Desktop\link-tracker
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Running the Server
On Mac:
cd ~/Desktop/link-tracker
source venv/bin/activate
python main.py
On Windows:
cd %USERPROFILE%\Desktop\link-tracker
venv\Scripts\activate
python main.py
You should see something like:
INFO: Started server process [12345]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000
The server is now running! Keep this window open while you use the system.
Getting Your URL Reports
For Colinkiri Indexing Service
Open your web browser and go to:
http://localhost:8000/urls/for-colinkiri
This will show you a list of URLs, one per line, that you can copy and paste into colinkiri. Important: After you visit this URL, those pages are marked as "submitted" so they won't appear in future reports.
For Other Indexing Services
Open your web browser and go to:
http://localhost:8000/urls/for-indexer
Same as above, but for a different indexing service.
Updating to the Latest Version
When updates are available, you can easily update the project:
- Stop the server (press
Ctrl + Cin the terminal) - Update the code:
git pull origin main - Update any new dependencies:
pip install -r requirements.txt - Restart the server:
python main.py
Note: Your data (link_tracker.db file) will not be affected by updates.
Stopping the Server
To stop the server, go back to your Terminal/Command Prompt window and press Ctrl + C.
Troubleshooting
"Command not found" errors:
- Make sure Python is installed and added to your PATH
- Try using
python3instead ofpythonon Mac - Try using
pyinstead ofpythonon Windows
"Port already in use" error:
- Another program is using port 8000
- Try changing the port in main.py (last line):
uvicorn.run(app, host="0.0.0.0", port=8001) - Then use
http://localhost:8001instead ofhttp://localhost:8000
Can't access the URLs:
- Make sure the server is running (you should see the "Uvicorn running" message)
- Check that you're using the correct URL:
http://localhost:8000 - Try refreshing your browser
Other Available Endpoints
These are for advanced users or developers:
View All Captured Pages
http://localhost:8000/pages
Shows all pages that have been captured with link information.
View Statistics
http://localhost:8000/stats
Shows overall statistics about captured pages and links.
Search for Pages Linking to Specific URL
http://localhost:8000/search/linking-to?target_url=https://example.com
Find all pages that link to a specific URL.
View Links for Specific Client
http://localhost:8000/clients/clientdomain.com/links
See all links pointing to a specific client domain.
API Documentation
http://localhost:8000/docs
Interactive API documentation (for developers).
Data Storage
The system automatically creates a file called link_tracker.db in the same folder as main.py. This file contains all your captured data. Don't delete this file unless you want to lose all your data.
Support
If you run into issues:
- Make sure Python is properly installed
- Make sure you're in the correct folder when running commands
- Check that the server is running before trying to access URLs
- Try restarting the server if something seems stuck