mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Replace OAuth client ID
Also do a better job of conforming to the Reddit API Terms of Use
This commit is contained in:
parent
20eae33207
commit
16d665228a
3 changed files with 21 additions and 18 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Unddit
|
# Unddit
|
||||||
[Unddit](https://www.unddit.com) is a site for undoing the removal of comments from [Reddit](https://www.reddit.com).
|
[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.
|
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.
|
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.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
// The app NEEDS TO BE an installed app and NOT a web apps
|
// The app NEEDS TO BE an installed app and NOT a web apps
|
||||||
|
|
||||||
// Current using dummy ID from throwaway
|
// 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
|
// Token for reddit API
|
||||||
let token
|
let token
|
||||||
|
|
@ -17,7 +18,8 @@ const getToken = () => {
|
||||||
const tokenInit = {
|
const tokenInit = {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Basic ${window.btoa(`${clientID}:`)}`,
|
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',
|
method: 'POST',
|
||||||
body: `grant_type=${encodeURIComponent('https://oauth.reddit.com/grants/installed_client')}&device_id=DO_NOT_TRACK_THIS_DEVICE`
|
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()
|
return getToken()
|
||||||
.then(token => ({
|
.then(token => ({
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `bearer ${token}`
|
Authorization: `bearer ${token}`,
|
||||||
|
'User-Agent': userAgent
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ const About = props => {
|
||||||
<b className='removed-text' title='Removed by mods'> removed </b>
|
<b className='removed-text' title='Removed by mods'> removed </b>
|
||||||
(by mods) and
|
(by mods) and
|
||||||
<b className='deleted-text' title='Deleted by users'> deleted </b>
|
<b className='deleted-text' title='Deleted by users'> deleted </b>
|
||||||
(by users) comments/posts from Reddit.
|
(by users) comments/posts for Reddit.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Usage</b>: Drag this bookmarklet
|
<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")'>
|
<a className='bookmarklet' href='javascript:window.open(location.href.replace(/:\/\/([\w-]+.)?(reddit\.com\/r|reveddit\.com\/v)\//i, "://www.unddit.com/r/"), "_blank")'>
|
||||||
Unddit
|
Unddit
|
||||||
</a>
|
</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 />
|
<br /><br />
|
||||||
Alternatively you can manually replace the <i>re</i> of <i>reddit</i> in the URL with <i>un</i>.
|
Alternatively you can manually replace the <i>re</i> of <i>reddit</i> in the URL with <i>un</i>.
|
||||||
<br />
|
<br />
|
||||||
|
|
@ -51,31 +51,31 @@ const About = props => {
|
||||||
<b className='question'>Q: How does it work?</b>
|
<b className='question'>Q: How does it work?</b>
|
||||||
<p>
|
<p>
|
||||||
This page is only possible because of the amazing work done by Jason.
|
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.
|
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.
|
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).
|
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.
|
By comparing the comments from these 2 APIs, we can figure out what has been deleted and removed.
|
||||||
</p>
|
</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>
|
<p>
|
||||||
Not much. Removeddit was created as a temporary replacement for ceddit, at a time when ceddit didn't work.
|
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.
|
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.
|
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.
|
Today both sites live side by side and strive for the same goal.
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
There are some minor differences in them though:
|
There are some minor differences in them though:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<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.
|
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.
|
If I had created Removeddit today I might had thought more about what was right here.
|
||||||
</li>
|
</li>
|
||||||
<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.
|
Removeddit also uses significantly less JavaScript on the page which also should make the page load faster.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Ceddit provides user lookup while removeddit doesn't.
|
Ceddit provides user lookup while Removeddit doesn't.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue