r/javascript • u/armastevs • Dec 03 '13
I rebuilt all of the functionality of Reddit using the Reddit API and Backbone/Marionette/Handlebars and added some features I thought Reddit needed. Introducing RedditJS.com
https://github.com/BenjaminAdams/RedditJS29
Dec 03 '13
All I get is a blank white page. IT'S SO CLEAN.
13
u/armastevs Dec 03 '13
Occasionally on pageload there is a Javascript error that causes the page not to render. RedditJS is still in beta, but I have been working very hard to prevent this from happening. I recently migrated a lot of the codebase from using Resthub to using Marionette This cut down on the error rate a lot.
6
0
Dec 03 '13
[deleted]
7
6
u/Spankth Dec 03 '13
if (typeof window.console == "undefined") { window.console = { log: function () { } }; }
There are console calls everywhere
0
2
7
Dec 03 '13
pretty cool, one comment, vim keys please ;)
4
u/armastevs Dec 03 '13
What do you mean?
7
u/aladyjewel Full-stack webdev Dec 03 '13
Basic keyboard navigation a la RES.
I wonder how easy it would be to drop RES in on top of redditjs.com (especially once we refactor out a lot of regexps checking for "are you on reddit.com"). I'm pretty certain some big pieces of functionality, like the account switcher, wouldn't work; but I bet a lot of it would work fine.
How faithfully did you reproduce the reddit HTML?
3
u/armastevs Dec 03 '13
Ah yes, the only keyboard interaction at the moment is to go to the previous/next post.
I would say it's at least 90% reproduced HTML pulled directly from reddit and replaced with handlebar template variables to create what you are looking at.
10
u/kenman Dec 03 '13
Cool, but I'm a little confused as to the purpose...
Was this just a toy project to practice on, or is it meant to be a feature-complete replacement for reddit.com?
25
u/armastevs Dec 03 '13
I feel that Javascript frameworks on the front end are a better way to create websites, I wanted to show that Reddit could easily be built in such a way.
I wanted to add features to Reddit, such as changing views gridview/fullview/thumbnails. Keyboard navigation on single posts that correspond to the bottom bar. Some of the features are just toys like the drop down subreddit menu with subreddit logos instead of the text of that subreddit.
The most important thing is the data resuse. You fetch that subreddit data once and it keeps it memory and you can visit a single page or revisit that subreddit and it does not need to refetch that data every time. Meaning that page will load instantly, or near instantly depending on the Javascript rendering that page (need to work on this to improve load times)
3
u/Ventajou Dec 03 '13
You did a really impressive job, it looks like the original but it got the JS treatment.
I think the main risk with switching all to a client side app becomes memory management. When you reload pages all the time you can be lazy because the browser will just clean everything up for you, but now you have to understand the GC a bit better.
Then of course there's the stale data stuff, you no longer get fresh data "for free" by just clicking on a link, it's essentially all cached now. I had the situation at work where we turned a part of a web app into a mini single page app and people started asking for refresh buttons all over the place.
4
u/armastevs Dec 03 '13
I feel I've done a pretty good job at preventing memory leaks, using marionettejs really helps with that.
If the user wants fresh data they can refresh the page. I wanted to keep and reuse as much data as possible throughout redditJS because the reddit API is SLOW typically takes between 1-4 seconds to get the reddit json back.2
9
u/interiot Dec 03 '13
Also, anyone can fork the UI now, and just make a few tweaks. Before, you had to do a monster amount of work to make that happen. Fortunately, this awesome person has done the monster amount of work, and made it reusable. :)
1
u/snarfy Dec 03 '13
Data reuse. I know this as caching.
How do you cache a subreddit, when by definition they are dynamic (front page always changes)?
Caching is not free. It's a trade-off between accuracy and speed. Is the speed increase worth the inaccurate front page? Will yesterday's stories be overrepresented on today's front page due to caching? Probably.
Awesome job, btw, and I'm not trying to detract from the great work you've already done, just trying to point out speed isn't always most important.
4
u/armastevs Dec 03 '13
The caching is used in only one window session. So if you refresh your browser it is cleared. It's cached by keeping it in a variable in memory. This is being done because the reddit api is SLOW 1-4 seconds or so. This tradeoff is worth it, the amount of data needed to cache one subreddit is not all that much.
The main purpose of caching subreddit data is going from subreddit to single post back to subreddit is a typical flow of reading reddit posts and you do not have to wait for the API to reload the subreddit data every time.
3
u/pi_over_3 Dec 03 '13
Reading your comment reminds of how cutting edge Digg originally was by using AJAX for voting on comments.
I wonder what will come after single page, js driven webapps.
1
1
Dec 04 '13
1
Dec 04 '13
I think Meteor has the edge on Derby at the moment, it's just too easy to get started quickly.
5
u/3ggsnbakey Dec 03 '13
I agree that using headless API endpoints and JS/HTML standalones to communicate is much better than the defacto reload/refresh sites (like reddit). I'm building my cross platform game Centerpoint like that with an Angular front end app and a REST endpoint that talk back and forth. Way better for scalability and performance when you start federating the architecture as SOA.
2
Dec 04 '13
Is this open-source? Looks incredible!
0
u/3ggsnbakey Dec 04 '13
Thanks! It's not yet but it will be once the project is moving along at a faster pace. We will be open sourcing the web API engine, the Angular JS web client, and the C# code (Unity3D) for both servers and clients. Our goal is to make it easier for cross platform, MMORPG games to be built.
0
Dec 03 '13
[deleted]
0
u/3ggsnbakey Dec 03 '13
It's still up and running, did you have trouble connecting? ;) DDOS away my friends!
It's not been that difficult and more of a build / qa / learn cycl. The real magic is that each respective game client connects to a web API, allowing users to cross devices without having to sync data. All stats, configs, even game objects get accessed from the cloud which makes the clients smaller and faster on boot.
Thanks for the comment!
0
1
u/kenman Dec 03 '13
Thanks for the reply, but you didn't really address my question at all:
Is this meant to be a permanent site, or just a POC/sandbox?
5
u/armastevs Dec 03 '13
It's meant to be a permanent site, but I also like to think of it like a sandbox where I can play with ideas on how to consume reddit better.
1
u/findar Dec 03 '13
There's a feature list in the github page, but he basically added in some features of RES into basic reddit as well as some performance enhancements.
2
u/armastevs Dec 03 '13
I only took a few features from RES such as opening images inline and showing the vote count next to the link. I've added a lot of features that RES does not have.
-1
u/kenman Dec 03 '13
Did you mean to reply to me? Because what you wrote doesn't address my question.
8
u/dadoprso Dec 03 '13
How do I know that this is safe to log into?
23
u/armastevs Dec 03 '13
You don't, same with any Reddit mobile app.
3
u/dadoprso Dec 03 '13
Hmmm yea, but those have reviews on play store. Just wondering. Good work; the site is awesome.
22
u/armastevs Dec 03 '13
food for thought...are these reviews made by people who have reviewed the source code and actually claim it being secure?
-2
u/dadoprso Dec 03 '13
Nope, but I figured someone would notice something funny happening with their account. Not the best security, I'll admit.
0
2
1
1
u/atomic1fire Dec 04 '13
Suggestion
If it's possible enable some kind of login via reddit page.
Being that this is a hosted website that looks almost exactly like reddit, randomly giving you a username and password seems like a bad idea.
Having to approve RedditJS seems like a better choice since we can always disapprove later.
16
u/alsogilbert Dec 03 '13
Because we can read the source?
7
u/dadoprso Dec 03 '13
Yep! Very good.
10
Dec 03 '13
Devil's advocate: no guarantee that this exact source is what's deployed on his server.
6
u/AnOnlineHandle Dec 03 '13
Also Devil's Advocate, we're all just going to presume that somebody else read the source and that it must be safe.
Right guys?...
5
3
u/tekrat Dec 03 '13
Looks great. How are you doing the user authorization? Is it pure JavaScript or does it go through a local server?
6
u/armastevs Dec 03 '13
The Reddit API requires that all HTTP Posts are done through a server. All of the Reddit API requests that are POSTs go through the NodeJS server it runs on here https://github.com/BenjaminAdams/RedditJS/blob/master/server/api.js
If the API request is a GET and the user is not logged in it uses JSONP to get the data from the API.
2
u/tekrat Dec 03 '13
Very cool and clean code. My concern was what someone else had said in the comments about if the server was secure. Keep up the good work.
-11
3
u/psolidgold Dec 03 '13
Looking good man. I'm working on a Marionette/Handlebars app right now. I'm curious to get your opinion on if you were to do it all from scratch again, what different choices would you make? Any tips that you wish someone would have told you before hand? What was the most challenging part? Again, great job.
2
u/armastevs Dec 03 '13 edited Dec 03 '13
I just said this in another comment:
I recently migrated a lot of the codebase from using Resthub to using Marionette This cut down on the error rate a lot.
If I had to start it all over again I would have used Marionette from the start.
The most challenging part is and still is to optimize the code. Currently it runs too slow on mobile devices. Or if you have 1000 posts open in that subreddit it takes too long to change views (grid view back to normal or to thumbnail view).
Also the structure of the files are important to keep in an organized manner, models/views/collections in their own folder.
1
u/psolidgold Dec 03 '13
Thanks for the reply. About your challenges- do you have a plan of action to solve these performance issues? Is it a memory usage problem?
1
u/armastevs Dec 03 '13
It's more of a Javascript CPU performance problem. I've knocked out most memory leaks you typically see between 10-35mb of memory usage in the profiler.
6
3
u/DarkLord7854 Dec 03 '13
Curious as to your thoughts on using Marionette are after what you learned from this project, would you use it again? Anything in particular you really liked or disliked compared to just Backbone or another lib on top of Backbone?
Did you run into any major issues (such as performance) while building it?
Also some nitpicky things:
I've seen a few views (like your base view) do quite a lot of things that shouldn't be handled by the view, but by it's model. Any particular reason for this?
Your models have almost no functionality (due to the above point)
You rely a lot on underscore functions, which are inherently much slower than native functionality, especially the loops
You use _.bindAll(this) a lot, but I don't really see any major case where it's particularly useful aside from convenience, and the way it works is actually pretty slow and adds a bit of overhead, plus it bloats your context significantly (it's also very rarely needed in backbone in the newest versions)
Not really seeing where you make heavy usage of the advantages that marionette brings to the table such as the prebuilt view types, though that might be the way reddit is layed out and it didn't make much sense
Also, you should consider swapping Underscore for LoDash or Lazy.js as they perform better with large datasets compared to underscore (both are more or less swappable with no issues with backbone)
1
u/armastevs Dec 03 '13
I absolutly love using Marionette, it really helps with memory leaks and keeping the view code organized using regions and using the ui layouts that I'm using here
Some major issues I faced were nested comments, at first using regular backbone would have trouble figuring out which comment to interact with ex: voting for a nested comment would vote for every comment in that tree. This was solved by using Marionetts region layout..
You are right in that I should have done more code in the models, this a problem that I could work on.
I typically just always use a _.bindAll(this) so I have consistent this's, I had no idea of the performance implications, I will see what happens when I take them away.
I have not considered using Lazy or loDash, looking at Lazy the performance differences are incredible. I will have to try it out.
Thanks for the feedback.
1
u/enkideridu Dec 04 '13
I did a benchmark for bindall (this) and explicit binding of each method a while back
The performance tradeoff seemed to be negligible (100ms when initializing 8000 objects at once). It also helps keep mental overhead low.
1
u/armastevs Dec 04 '13
So basically it would save loading a subreddit with 1000 posts (max amount per subreddit) about 8-10ms~ this might be considered worth it because slower machines/mobile/ie8 might take even longer, so it could save 50ms~ for them. Right now I'm in optimization mode for RedditJS and this could be a great starting point.
1
u/automathematics Dec 03 '13
I would highly recommend moving away from _.bindAll(this) and just bind the functions you need 'this' to be consistent (mostly just callbacks, it seems).
2
u/circa7 Dec 03 '13
You're probably already aware but the site is basically unusable on mobile. On my iphone, at least.
4
u/armastevs Dec 03 '13
You are correct, phones typically have slower Javascript performance. Optimizing the code to work everywhere is an important next step. Try it out on your desktop when you get home =)
1
u/circa7 Dec 03 '13
I'd venture to guess it would simply be the css that would solve the problem, not JavaScript rendering. Functionality works fine, the layout is just broken.
2
u/armastevs Dec 03 '13
You are partly correct, it needs a mobile specific stylesheet to make it look nice in phones, but the Javascript performance is very low in phones causing page changes to be very slow..something I need to work on.
1
u/circa7 Dec 03 '13
Javascript performance seems fine on my phone. The only problem I have is visual.
1
u/chewmieser Dec 04 '13
Yeah it's definitely mostly the view. Seems snappy enough on mobile (could definitely be optimized more, but that's not a massive issue).
Cool project though!
2
u/christophermoll Dec 03 '13
Looks awesome! I know you didn't ask for suggestions, but could you make the video and picture icons different? I rarely ever click videos, and RES having different icons makes it easy to look right past them.
Also, how much CSS were you able to recycle from reddit itself, or did you have to do all that yourself? It really mimics the site pretty well. I mean I know it's not crazy CSS, but that part of the project just seems tedious compared to all the JS magic.
2
u/armastevs Dec 03 '13
I'd love to hear any suggestions, in particular suggestions on ways to view a subreddit.
As for the CSS, I copied the main reddit CSS file over and added a lot of my own CSS. The reason I had to copy all of the reddit CSS is because I wanted to make RedditJS compatible with individual subreddit styles. You can see the CSS I wrote for it here: https://github.com/BenjaminAdams/RedditJS/blob/master/public/css/style.css
2
u/nucleardreamer Dec 03 '13
In your api.js, you can just use querystring instead of parsing all that junk.
1
u/armastevs Dec 03 '13
Thanks, will have to try it out when I have more time.
2
u/geek_dave BackboneJS Dec 03 '13
Another option that I use in my Backbone projects: https://github.com/jhudson8/backbone-query-parameters
Seamlessly converts URL params from your Backbone router into vars, arrays, objects, etc.
1
2
Dec 04 '13
Nice job!
But how do I access the links in the footer? (The main reason I visit Reddit is to read the User Agreement!!1!)
Also, when the front page of RedditJS.com has a couple hundred submissions displayed, it takes about two full seconds for me to return to the front page from a discussion using my Back button, rather than less than one second at Reddit.com. (Suboptimal support for Back button seems to be very common at sites with client-side-rendered HTML.)
2
u/armastevs Dec 04 '13 edited Dec 04 '13
Yeah, you're right, this is something I need to work on. Optimizing the JS that powers the subreddit loads need a lot of improvement.
Your comparison might be a little unfair vs the reddit.com loading. Reddit.com only loads (up to) 100 posts at a time and redditjs can face up to 1000 posts at a time. If I were to limit redditJS to a max of 100 posts per page it would eliminate this problem.
I took out the footer because its useless to most users.
2
u/badmonkey0001 Dec 04 '13
it takes about two full seconds for me to return to the front page from a discussion using my Back button
Possible easy solution: add an "open comments and posts in new tab/window" feature to toggle.
On a side note, you may want to try to find a way to display Reddit's ads as well or find some other way to support server costs (RedditGifts links? I see you implemented Reddit Gold.). Don't want to just suck the well dry.
1
u/armastevs Dec 04 '13
Thats an easy solution, but if they open the post in a new tab it wont take advantage that the post in already in memory (it won't load instantly)
I'm already showing a reddit advertisement in the sidebar.
1
25
u/Sir_Travis Dec 03 '13
If only you lived in LA, I'd definitely be interested in hiring you full time. We need another solid front end dev.
19
Dec 03 '13
maybe consider remote?
3
u/Sir_Travis Dec 05 '13
Not against it for established employees, but looking for in house for the time being.
2
Dec 04 '13
Seriously. LA is prime for UI work. There just isn't enough good talent.
1
Dec 04 '13
Because all people want to build is prototypes for would-be investors.
1
Dec 04 '13
That's far from the work environment in LA. There's a lot of nice companies to work for here that have been around for a long time. If anything SF would be the place for "would-be investors". LA is mostly retail or media.
1
u/Sir_Travis Dec 05 '13
That goes for anywhere, but thats not the only reason LA is lacking talent. In the last 2 years, a lot of the large media companies in hollywood have been inhaling all the talent (good and bad) as fast as they can and bringing them in house, rather than using outside firms.
Most of the large blockbuster movies have websites, apps, web games, even mobile games sometimes, advertisements in every form (including banner ads), etc.
0
Dec 04 '13
[deleted]
1
u/Sir_Travis Dec 05 '13
Hard to do in a small company, but its never off the table entirely.
1
Dec 05 '13
Relocation costs can be, what, up to 15k or so? (guessing, not sure how much it costs to get someone's furniture across a country). Maybe it's even cheaper to just buy 'em a new set of furniture :) It might well be a worthwhile investment, considering how much money someone like that is likely to bring in for you, right?
57
u/gorillamania Dec 03 '13
Someone deserves a job at reddit! Here's my appreciation:
+/u/bitcointip 1 beer verify
10
u/cardevitoraphicticia Dec 03 '13
hurry up and sell before the crash!
2
u/DemeGeek Dec 03 '13
If everyone sells, then they will cause the crash!
As long as the hype train keeps going, everything will keep going but once you put your bitcoins on the track, you are going to derail it!
2
u/cardevitoraphicticia Dec 03 '13
The only person to win is the guy who sells first.
3
u/DemeGeek Dec 03 '13
Well, the only person to win the most, people will still make money albeit at a lower amount for the first little bit before bitcoins drop below the value that people bought them at.
Of course this is all based upon the thought that once the value dips at all everyone will run around like headless chickens trying to sell their own loot. This is the most likely scenario but it's also possible that enough people will believe that people selling is just a phase, and that it will get better again. If that happens, it will actually go up... until people lose hope again.
2
u/colordrops Dec 04 '13
Assuming it won't recover quickly or at all, and you are only it for short term gains. Fuck those people anyway. Some of us actually want bitcoin to succeed as more than a speculative investment.
19
u/tomtheimpaler Dec 03 '13
Fucking god damnit. This is another of my ideas I failed to get off my ass and complete and now I see it posted online better than I would have done it anyway. I need to stop doing doing this
11
6
Dec 03 '13
Or you could contribute to the opensource project that's available. https://github.com/BenjaminAdams/RedditJS
also, Brain Crack: http://www.youtube.com/watch?v=UvL6NITEozY&list=SP5DCE42EFF018B478
0
1
u/TheMoonMaster Dec 03 '13
Very neat. I think it would be worth ditching the regular reddit layout for something more suited for a single page application. That and custom stylesheets are making it awkward.
1
u/armastevs Dec 03 '13 edited Dec 03 '13
I am aware that the custom style sheets don't always look good in RedditJS, but sometimes they look amazing http://redditjs.com/r/earthporn. I have an option in the preferences that disables custom style sheets if its ever a problem.
1
u/TheMoonMaster Dec 03 '13
The transition to custom stylesheets is my main point. It's almost grating. It would feel much better with a consistent solid UI that doesn't change. It would also allow you to go into more features than just the default reddit set.
1
u/tebriel Dec 03 '13
I did notice that if I went to /r/wtf and refreshed, the app didn't load up. Perhaps a bootstrapping issue?
But nonetheless, very nice!
1
u/armastevs Dec 03 '13
There are some issues that it crashes because of a JS error before the page loads it happens maybe every 1/20 times, this is something I need to work on. If you refresh the page it should work.
1
u/MeoMix Dec 03 '13
Hey, well done. Couple of questions --
What are your thoughts on Marionette? I develop a Google Chrome extension which is slowly transitioning into a medium/large scale application. It's written with Backbone, but I haven't found the time to try out Marionette and see if it is worth it. Your experiences?
Any reason for using Handlebars over the implicit templating engine provided by Backbone? I'm fully content with lodash's _.template and just curious what you wanted a full engine for.
How many hours (est.) did it take you to build this? Are you happy with the code base?
What's your dev. experience like?
Are you interested in working on other open source, Backbone projects? If so, take a look at Streamus and feel free to get back to me about it: http://streamus.com https://github.com/MeoMix/StreamusChromeExtension
Thanks man. Cheers :)
1
u/armastevs Dec 03 '13
Using RequireJS/Backbone/Marionette is a great way to keep large JS projects organized. I suggest trying it if you have 2 or more views.
No other reason than I like using handlebars.
It's hard to say how many hours I worked on this. Some days it would be for 12 some days just a few. I would say around 300 or so hours total in the span of 3 months. A good indication of the hours worked is on this git commit graph. I am still not very happy with the codebase, the load time of the Javascript CPU is still too great if I ever want to see this project take off.
I have a CIS degree and have worked with PHP/Wordpress sites in the first 5 years and in the past 2 years I have focused more on Backbone/Nodejs projects.
Maybe...
1
u/throbbaway Dec 04 '13 edited Aug 13 '23
[Edit]
This is a mass edit of all my previous Reddit comments.
I decided to use Lemmy instead of Reddit. The internet should be decentralized.
No more cancerous ads! No more corporate greed! Long live the fediverse!
1
u/armastevs Dec 04 '13
Thanks!! I prefer grid view for subreddits that are image heavy and full view for ones that are links/self posts.
1
1
u/webbson Dec 04 '13
Hmm it works great when I get logged in. But the first time it said "you are doing that too much. try again in 9 minutes." and then when the countdown was completed I could log in.
Now when I went to the site again, despite the "remember me" box being checked earlier I was logged out. And when trying to log in I got "you are doing that too much. try again in 1 hour." This is going to be a long wait.
Edit: And now a ctrl-r of the page showed me as logged in. Weird.
1
1
u/zuperxtreme Dec 04 '13 edited Dec 04 '13
Anywhere we can report bugs?
Navigate to: http://redditjs.com/r/AdviceAnimals/
Click "All" on the Top Nav bar
Sidebar is still showing the AdviceAnimal's on
EDIT: Seems like it only reloads the content, happens when you change subreddit from the navbar.
1
u/armastevs Dec 04 '13
You are right, it currently only removes the custom CSS when you visit the front page. I will fix this shortly.
1
2
3
u/thefinn93 Dec 03 '13
No oauth? I'd really rather not give you my reddit password...
3
u/Strider96 Dec 03 '13
Uhhh.... That's the reddit api for you. Blame reddit not him.
10
u/thefinn93 Dec 03 '13
Reddit has full support for Oauth and has had it for a while. I blame him, not reddit.
4
u/kevmo Dec 04 '13
But it doesn't look like every API call supports Oauth. http://www.reddit.com/dev/api
1
2
1
u/Viat Dec 03 '13
Oooh, snappy. I feel like I'm in uncanny valley a little because of the almost perfect redditsembalence, but the apparent response time is awesome.
1
u/mnsota Dec 03 '13
Nice work! I clicked around for awhile and it eventually broke and starting throwing callback errors in Chrome (i'm a btz too lazy to throw this on github at the moment):
Uncaught TypeError: Property 'jQuery191024850071570836008_1386109928109' of object [object Object] is not a function api.reddit.com/comments/1s0jk0.json?jsonp=jQuery191024850071570836008_1386109928109&sort=undefined&_=1386109928127:11
1
1
u/jermsv1 Dec 04 '13
Great work! Love all the thumbnail, grid, viewing.
If i find sometime, I'd like to implement the front-end using AngularJS while I'm still learning it.
1
1
u/SlashmanX Dec 04 '13
Really great work, love seeing projects like this. One small issue though:
The links to submissions are links to the comments/thread rather than the actual link to the image etc, this means that Hover Zoom does not work. Any chance this could be fixed?
1
1
u/LightShadow Dec 03 '13
Neat.
+/u/bitcointip 2 internets verify
2
u/bitcointip Dec 03 '13
[✔] Verified: LightShadow → $0.50 USD (µ฿ 466.82 microbitcoins) → armastevs [sign up!] [what is this?]
0
Dec 03 '13
[deleted]
11
u/armastevs Dec 03 '13
Gridview in a NSFW subreddit could get you fired =)
1
u/AnOnlineHandle Dec 03 '13
Gridview is incredible! This has dramatically improved my redditing. Though I presume that I should download and run it locally if I want to use it long term...
5
u/armastevs Dec 03 '13
Grid view and full view are my favorite! My goal is to consume reddit in a more efficient way.
You can run it locally if you want. In Linux.
Clone the repo
run npm install
run grunt
after that you should just have to type "nodemon" and it will run locally
2
1
u/Swingline0 Dec 04 '13
Admittedly, this is the first thing I tried. Woah...
Awesome work though. Seriously good!
0
Dec 04 '13
[deleted]
1
u/armastevs Dec 04 '13
I will have to make an option to hide NSFW posts in gridview/full views.
There is an option in the preferences where you can turn off the auto-popup images/videos in the comments. You can access the preferences here http://redditjs.com/prefs/
0
Dec 03 '13
[deleted]
3
u/armastevs Dec 03 '13
Good suggestion, I would have a lot to write about RedditJS. It's on github because I wanted to showcase my ability to write Javascript to potential employers, In particular I would like to be employed by a fellow redditor. Github is also just a good way to keep a backup of your code, and if someone wanted to contribute I probably wouldn't turn them away.
0
Dec 03 '13
[deleted]
1
u/armastevs Dec 03 '13
Well, on regular reddit you dont have to refresh the page to vote/hide either.
MY RANDOM might not have worked because it was in the process of loading your current subreddits? Refresh the page and try again. I might have to take away this feature because its technically a reddit gold feature only!
If you are logged in, it will show you your subreddits, if not it will show you only the default subreddits.
0
Dec 03 '13
[deleted]
1
u/LightShadow Dec 03 '13
Use something like NLTK to determine if comments are positive or negative. Assign a fraction of point to the upvote / downvote counter where as more comments are posted the comment-sifter becomes less relevant.
This could also be extended to the poster if they want this feature for their post or not (will cause momentum, postive and negative).
The analysis module could also look for triggers, like /+ /- /s so their comment can't be mis-interpreted by the algorithm. A sarcasm flag would flip a coin ;)
/+
32
u/findar Dec 03 '13
Nitpicky: When switching from Hot to New or any other tab first time it loads data the spinner is off to the side. On a wide screen a bit harder to notice.
ps: Great job Ben.