Skip to content

Commit da663a3

Browse files
committed
Add fix-disqus-comments-to-https.sh
1 parent 7018dca commit da663a3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
public/
22
.DS_Store
33
.directory
4+
*.csv

fix-disqus-comments-to-https.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
if [ "$1" == "" ]; then
3+
echo 1. Open https://hypriot.disqus.com/admin/discussions/migrate/ and start the URL mapper.
4+
echo 2. Download CSV and run this script with it.
5+
echo 3. Upload new CSV to migrate all links to https.
6+
exit 1
7+
fi
8+
9+
input=$1
10+
output=${input//.csv/-upload.csv}
11+
rm -f "$output"
12+
echo "Fixing CSV $input -> $output"
13+
while read -r link; do
14+
link=${link///}
15+
httpslink=${link//\?*/}
16+
httpslink=${httpslink//http:/https:}
17+
echo "$link,$httpslink" >> "$output"
18+
done <"$input"

0 commit comments

Comments
 (0)