This package automatically uploads Finnish casino content to WordPress using the REST API.
π Content Structure
The uploader processes content from the following directories:
– paasivut/ β WordPress Pages (Main pages like homepage)
– arvostelut/ β Posts in “Kasinoarvostelut” category (Casino reviews)
– oppaat/ β Posts in “Oppaat” category (Guides and tutorials)
– pelit/ β Posts in “Oppaat” category (Game guides)
– maksutavat/ β Posts in “Maksutavat” category (Payment methods)
– kategoriat/ β Posts in “Kategoriat” category (Category pages)
π Quick Start
1. Setup
“`bash
# Run the setup script
setup.bat
“`
2. Configure WordPress Credentials
1. Go to WordPress Admin β Users β Your Profile
2. Scroll to “Application Passwords”
3. Add new application password
4. Copy the generated password
5. Update `WP_PASSWORD` in `wp_content_uploader_fi.py`
3. Test Connection
“`bash
# Test WordPress connection
test_connection.bat
“`
4. Upload Content
“`bash
# Upload main pages first (recommended)
upload_main_pages.bat
# Upload all content
upload_all_content.bat
# Or upload specific content types:
upload_casino_reviews.bat
upload_guides.bat
“`
π Available Scripts
Script | Description |
---|---|
`setup.bat` | Install dependencies and show setup instructions |
`test_connection.bat` | Test WordPress connection and permissions |
`upload_all_content.bat` | Upload all markdown files |
`upload_main_pages.bat` | Upload only main pages (homepage, etc.) |
`upload_casino_reviews.bat` | Upload only casino reviews |
`upload_guides.bat` | Upload guides and game content |
βοΈ Configuration
Edit `wp_content_uploader_fi.py` to configure:
“`python
WP_BASE_URL = “http://casino5.local” # Your WordPress URL
WP_USERNAME = “admin” # WordPress username
WP_PASSWORD = “your-app-password” # Application password
“`
π― WordPress Categories
The uploader automatically creates these categories:
– Kasinoarvostelut (arvostelut) – Casino reviews
– Oppaat (oppaat) – Guides and educational content
– Maksutavat (maksutavat) – Payment method information
– Kategoriat (kategoriat) – Casino category pages
– Sivut (sivut) – Core website pages
π Content Processing
The uploader converts Markdown to HTML with:
– β Headers (H1-H5)
– β Bold and italic text
– β Links
– β Tables with styling
– β Paragraph formatting
– β Star ratings for reviews
π§ Troubleshooting
Connection Issues
– Ensure WordPress is running at the configured URL
– Check that REST API is enabled
– Verify application password is correct
Upload Issues
– Check file permissions
– Ensure markdown files exist in expected directories
– Review WordPress error logs
Content Issues
– Verify markdown syntax is correct
– Check for special characters in titles
– Ensure file encoding is UTF-8
π File Structure
“`
suomi/
βββ wp_content_uploader_fi.py # Main uploader class
βββ upload_all_content.bat # Upload all content
βββ upload_main_pages.py/.bat # Upload main pages only
βββ upload_casino_reviews.py/.bat # Upload casino reviews only
βββ upload_guides.py/.bat # Upload guides only
βββ test_connection.py/.bat # Test WordPress connection
βββ setup.bat # Setup and install dependencies
βββ requirements.txt # Python dependencies
βββ README.md # This file
“`
π WordPress Setup After Upload
1. Set Homepage: WordPress Admin β Settings β Reading β Static Page
2. Create Menus: Appearance β Menus β Create navigation
3. Check Categories: Posts β Categories β Verify all categories created
4. Review Content: Check all pages and posts uploaded correctly
π‘ Tips
– Upload main pages first to establish site structure
– Test with a few files before uploading all content
– Always backup your WordPress site before bulk uploads
– Check content formatting after upload and adjust as needed