Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ yarn.lock
config.json
npm-debug.log
*.sublime-*
.DS_Store
.DS_Store
/.idea
/wordpress-comments.xml
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
{
"name": "g-div",
"web": "https://github.com/g-div"
},
{
"name": "Jerram Digital",
"web": "https://jerram.co.uk/"
}
],
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/db/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
WHERE provider = ? AND provider_id = ?`,

create_user:
`INSERT INTO user
`INSERT OR IGNORE INTO user
(provider, provider_id, display_name, name, url,
created_at, trusted, blocked)
VALUES (?, ?, ?, ?, ?, datetime(), ?, 0)`,
Expand Down
8 changes: 7 additions & 1 deletion src/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ async function parse(file) {
}

function getWPAuthor(comment) {

let provider_id = comment['wp:comment_author'];
if (comment['wp:comment_user_id'].toString().length && !isNaN(comment['wp:comment_user_id'] * 1)) {
provider_id = comment['wp:comment_user_id']
}

return [
'wordpress',
comment['wp:comment_author'],
provider_id,
comment['wp:comment_author'],
comment['wp:comment_author'],
0
Expand Down