Replace OAuth client ID

Also do a better job of conforming to the Reddit API Terms of Use
This commit is contained in:
Christopher Gurnee 2021-11-01 11:38:18 -04:00
parent 20eae33207
commit 16d665228a
3 changed files with 21 additions and 18 deletions

View file

@ -1,6 +1,6 @@
# Unddit
[Unddit](https://www.unddit.com) is a site for undoing the removal of comments from [Reddit](https://www.reddit.com).
Just go to any reddit post and replace the `re` of `reddit` in the URL with `un` to see all removed comments.
[Unddit](https://www.unddit.com) is a site for undoing the removal of comments for [Reddit](https://www.reddit.com).
Just go to any Reddit post and replace the `re` of `reddit` in the URL with `un` to see all removed comments.
This is a done by comparing the comments being stored in [Jason Baumgartner's](https://pushshift.io/) [Pushshift Reddit API](https://github.com/pushshift/api) and the ones from Reddit's API. The frontend, developed by Jesper Wrang and originally available at [removeddit.com](https://removeddit.com), is written in [React](https://reactjs.org/) and uses [Sass](https://sass-lang.com/) as the CSS Preprocessor.

View file

@ -2,7 +2,8 @@
// The app NEEDS TO BE an installed app and NOT a web apps
// Current using dummy ID from throwaway
const clientID = 'Gu4d7t1AglWJVg'
const clientID = 'ZmYXJ5RaSDhF-77YaFulWw'
const userAgent = 'com.unddit.www (by /u/unddit-com)'
// Token for reddit API
let token
@ -17,7 +18,8 @@ const getToken = () => {
const tokenInit = {
headers: {
Authorization: `Basic ${window.btoa(`${clientID}:`)}`,
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
'User-Agent': userAgent
},
method: 'POST',
body: `grant_type=${encodeURIComponent('https://oauth.reddit.com/grants/installed_client')}&device_id=DO_NOT_TRACK_THIS_DEVICE`
@ -36,7 +38,8 @@ export const getAuth = () => {
return getToken()
.then(token => ({
headers: {
Authorization: `bearer ${token}`
Authorization: `bearer ${token}`,
'User-Agent': userAgent
}
}))
}

View file

@ -16,14 +16,14 @@ const About = props => {
<b className='removed-text' title='Removed by mods'> removed </b>
(by mods) and
<b className='deleted-text' title='Deleted by users'> deleted </b>
(by users) comments/posts from Reddit.
(by users) comments/posts for Reddit.
</p>
<p>
<b>Usage</b>: Drag this bookmarklet
<a className='bookmarklet' href='javascript:window.open(location.href.replace(/:\/\/([\w-]+.)?(reddit\.com\/r|reveddit\.com\/v)\//i, "://www.unddit.com/r/"), "_blank")'>
Unddit
</a>
to your bookmark bar and use it to get from reddit to Unddit.
to your bookmark bar and use it to get from Reddit to Unddit.
<br /><br />
Alternatively you can manually replace the <i>re</i> of <i>reddit</i> in the URL with <i>un</i>.
<br />
@ -51,31 +51,31 @@ const About = props => {
<b className='question'>Q: How does it work?</b>
<p>
This page is only possible because of the amazing work done by Jason.
His site <a href='https://pushshift.io/'>pushshift.io</a> activly listens for new comments on reddit and stores them in his own database.
Then sites like Unddit and reveddit can fetch these comment from pushshift.
Unddit know what comment reddit shows (from Reddits API) and what comment should be showed (from Pushshifts API).
His site <a href='https://pushshift.io/'>Pushshift.io</a> actively listens for new comments on Reddit and stores them in his own database.
Then sites like Unddit and reveddit can fetch these comment from Pushshift.
Unddit know what comment Reddit shows (from Reddit's API) and what comment should be showed (from Pushshift's API).
By comparing the comments from these 2 APIs, we can figure out what has been deleted and removed.
</p>
<b className='question'>Q: What's the difference between ceddit and Removeddit?</b>
<b className='question'>Q: What's the difference between Ceddit and Removeddit?</b>
<p>
Not much. Removeddit was created as a temporary replacement for ceddit, at a time when ceddit didn't work.
I thought this was necessary since I used ceddit more then Reddit itself.
Months later ceddit was fixed, but I didn't see any reason to remove what I had done.
Not much. Removeddit was created as a temporary replacement for Ceddit, at a time when Ceddit didn't work.
I thought this was necessary since I used Ceddit more then Reddit itself.
Months later Ceddit was fixed, but I didn't see any reason to remove what I had done.
Today both sites live side by side and strive for the same goal.
</p>
<div>
There are some minor differences in them though:
<ul>
<li>
Ceddit respect user made deletions while removeddit does not. This decision was made early on and I feel like it's too late to change now.
If I had created removeddit today I might had thought more about what was right here.
Ceddit respect user made deletions while Removeddit does not. This decision was made early on and I feel like it's too late to change now.
If I had created Removeddit today I might had thought more about what was right here.
</li>
<li>
Removeddit usualy loads faster since it uses a slightly different algorithm for detecting removed comments.
Removeddit usually loads faster since it uses a slightly different algorithm for detecting removed comments.
Removeddit also uses significantly less JavaScript on the page which also should make the page load faster.
</li>
<li>
Ceddit provides user lookup while removeddit doesn't.
Ceddit provides user lookup while Removeddit doesn't.
</li>
</ul>
</div>