These scripts can be used to
- register an OAuth 1.0a application
- scrape the old serendipity Bingo Blog
- transform and upload content to a Wordpress site
Use collectBlog.py
to scrape the Bingo e.V. blog.
URLs are static and content is parsed using BeautifulSoup4 with lxml. Can probably be made to work with other somewhat recent serendipity versions (≥1.5.3-2) as well.
After scraping is done, the generated authors.yml
file needs to be edited to add a Wordpress slug for every serendipity user:
<serendipity id>:
name: ...
slug: <wordpress slug>
posts: ...
The oauth.py
works using YAML configuration files like shown in config.example.yml
.
As a bare minimum, you need the following information to register with a new site:
url: http://wordpress.example.com
oauthCallback: oob
consumerKey: <Field Client Key>
consumerSecret: <Field Client Secret>
oob
is the only callback supported by the script.
This code words in conjunction with the WordPress REST API – OAuth 1.0a Server plugin.
Once installed, create a new application and use oob
(out-of-band) callback and fill in the consumerKey
and consumerSecret
as indicated above.
Then use oauth.py --config siteConfig.yml register
to register with the new site.
This requires logging into your Wordpress using an account with the desired privileges, granting the application access and then pasting the verifier token into the Python command line.
After that, the script will finish registration and print out a complete configuration file.
You only need to register once even if you want to transfer multiple times.
Use oauth.py --config siteConfig.yml transfer path/to/scraped/data
to transfer the scraped data to Wordpress.
The script can create the required users in an optional step using the --create-users
command line option.
There is no support for directly adding media files from serendipity yet, as there were so few. The files are downloaded and the metadata is stored in the corresponding post data, but no upload functionality was implemented.