giscus / giscus

A comment system powered by GitHub Discussions. :octocat: :speech_balloon: :gem:
https://giscus.app
MIT License
8.24k stars 334 forks source link

question - Is it possible to import disqus comments into giscus? #330

Open gaocegege opened 2 years ago

gaocegege commented 2 years ago

Hi thanks for the awesome comment system!

I am wondering if it is possible to import disqus comments into giscus?

DerGoogler commented 2 years ago

No it won't.

laymonage commented 2 years ago

Reiterating my point from #196:

Importing is possible, with a few caveats because the imported discussions and comments will be made as new ones. Some caveats I can think of right now:

  1. Timestamps on the comment itself will be replaced by the timestamp of your import.
  2. The comment author would be replaced by your (or your bot's) GitHub username. There's no way to create a new comment on behalf of the actual author unless they have a GitHub account and they explicitly give you the permission.

Original information for (1) and (2) can still be shown by including it in the comment body, e.g.

On Oct 17, 2021, @samarulmeu wrote: Actual comment body here

But of course, someone needs to write the import script for that to work. I don't have the time to work on it yet.

knpwrs commented 2 years ago

There is prior art from utterances which may be interesting: https://github.com/utterance/utterances/issues/7#issuecomment-439831514

bric3 commented 1 year ago

Hi for information, I was also hitting this issue, and I decided to write a tool that can migrate a Disqus export as GitHub Discussions, it's far from perfect, and clearly I probably didn't fully tested edge cases.

https://gist.github.com/bric3/af915687717d9aa06b0f9b06d600c127

Basically the steps are (You need a Java 19 install and jbang)

  1. Go to the Diqus export page

  2. Optional Extract the authors, to manually configure a mapping to Github Users

    $ jbang https://gist.github.com/bric3/af915687717d9aa06b0f9b06d600c127 \
     -f forum-name-on-discus \
     -e disqus-export.xml \
     -a

    Removing lines without match

    - Brice Dutheil
    + Brice Dutheil,@bric3
    - Anonymous
    - Carlos
    + Carlos, @carlos
    - Bob

    Note: when testing you may want to remove @ to avoid spamming actual users.

  3. Make the conversion (I strongly suggest to try that on a temporary repository)

    $ env GITHUB_TOKEN=$(op item get "Github" --fields "gh-cli") \
     jbang https://gist.github.com/bric3/af915687717d9aa06b0f9b06d600c127 \
     -f the-forum-name \
     -e disqus-export.xml \
     -r bric3/bric3.github.io \
     -c "My Category" \
     -m pathname \
     --host https://blog.arkey.fr \
     -u author-mapping.csv \
     -o "@bric3" \
     -s

    Note : there's also a dry-run mode (--dry-run or -n) that will instead show what discussions and comment will be sent to GitHub.

Here's a simple blog post explaining a tad more my experience during the migration from Discus to Giscus.

LITUATUI commented 5 months ago

Hi guys.

Is there an update to the best way of importing Disqus comments to Giscus?