evancofer / reddigest-scalafied Goto Github PK
View Code? Open in Web Editor NEWA rewrite and revamp of reddigest
A rewrite and revamp of reddigest
Not sure if these will be at all used in the scala code, but may be useful?
Need a way to filter reddit json api requests so that we only receive links that are newer than a certain time, otherwise we are constantly fetching a bunch of links that we've already seen each time we try and get new links.
Note that if the username
& password
fields are non-empty for login
and login
button is green, then register
will also be green, despite its respective username
& password
fields being empty.. The same occurs if the fields for register
are filled: login
will be green. We want them to only become active when their specific fields have been filled.
SEE: #15
We currently respond to client link validation request with an array of booleans of equal size. A boolean in a given index is true if the link with the same index in the request is indeed new link. If the link exists in the database, the boolean is false. We do not have a method of parsing these responses from json before we can act on them.
We want the login
and register
buttons become green immediately when their respective username
and password
fields are non-empty. However, it currently only works if we mouse-over the button after their fields are non-empty. We want the buttons to listen for keyup on these fields.
Note that we are doing all DOM styling and effects (such as this) in pure javascript/jquery, NOT in Scala.js. For things such as this we are doing lightweight scripting and as such we need a lightweight scripting language such as javascript. For this, scala.js requires too much setup and is not well enough supported/documented/implemented to guarantee ease of use, and would only serve to create a layer of obfuscation. Therefore, all functions for these effects should go into server/public/javascripts/scripts.js
. Note that all native (i.e. non scala.js) javascript functions must be named with js_
prepended to their name like js_foo()
. This is to prevent any possibility of conflict with the separate body of scala.js code.
The html for the links page has not been tested yet. This is being blocked by the lack of a db, and lack of link fetching. Once those are implemented, we can test how the links look and fiddle with the html being produced by TableRow
Need to make a method by which the client can remove a link from their table and the link is then replaced. This involves tying the functionality of removing and getting a link to an href/button in each row. This button should call a method in the TableRow
companion object which somehow maps to the individual row corresponding to the refresh button that was clicked. The companion object should call getLink()
from the LinkSource
and then refreshLink
in the corresponding TableRow
with the new link as an argument. The TableRow
should then modify the corresponding DOM content to reflect this link. We will have to determine whether it is more efficient to modify all of the associate DOM content, or just the changed DOM content.
Need to write single link validation method on the server.
User actions are things like login, logout, account registration, or account deletion. Need to have some windows or a div on client side that appears when a user actions fail. Need to write a view template for this case.
If we're doing ajax calls, we can easily render a nice box in the dom above the login/account deletion fields if the actions fail. Let's not do popups because they are obnoxious.
We need to write the client code to act upon replies from client-side link validation requests to server. By response, I mean things like determining whether or not to fetch more links from reddit or returning a link(s). This response should be indifferent for single link validation and multiple link validation.
Need to create LinkSource
's method of fetching links from reddit.
Need a page for where users can delete account.
https://github.com/lihaoyi/scalatags could make the client side row formatting much less of a headache to look at.
We need a standard file to create the sql database.
Need two password fields for account creation. This requires making a custom form for user registration that takes two such fields. Moreover, we need to add server side checking to ensure both passwords are the same.
Need some way of passing a username down to the user_toolbar
template from nested templates that allows it to display the current users account name either in the page title or in the account actions page. This arg does not get passed down past the user_toolbar
template, and only appears on authenticated user pages, so we don't need to make this an option[string] as I initially thought.
We currently have a method on the server by which we can validate multiple links sent to the server, but we have not yet implemented the client side ajax calls to send multiple links at once to the server. This method of link fetching is ideal, as we can then grab a batch of links from reddit each time we need more links, and then simply grab a link out of this set of validated links each time we need a new one. This can continue until we run out of fresh links. Otherwise, the client has to validate every single time they close a link and try to fetch a new one, which could seriously slow down the ui responsiveness.
Application controller and routing need to have the ability to validate a set of links at once, rather than one at a time.
We should encapsulate all link functions requiring communication with the server or reddit. We should put them inside a LinkSource
object on the client side, with an interface of getLink()
and removeLink(link)
. The first, getLink()
should return a fresh link every time. The other, removeLink(link)
tells LinkSource
that link
has been seen, and to tell the server to add it to the database.
Furthermore, we need to determine the logic with which to act upon replies from client-side link validation requests to server. By response, I mean things like determining whether or not to fetch more links from reddit or returning a link(s). This response should be indifferent for single link validation and multiple link validation.
Need LinkSource
to load links on page load.
Need to write methods for client side to send a single link to the server to be checked/validated as new.
Need to create the method of constructing the link table and passing dom elements to link elements.
Reddit's JSON api will only allow us to fetch 100 links at a time (https://www.reddit.com/dev/api). This presents a problem, as if all 100 of those links have been seen before, we need to use a link id for after
to find posts after the last of these 100 posts. After that, each iteration of 100 posts should do the same thing. However, this is rather time sensitive, as after
is not chronological, but instead correlated to ranking. We will likely need to store it in the cache of the user, and then timestamp their last access to reddigest in the database. With this, we can see if the users after
post is too old or not. On the other hand, if the after
post is still new, it's not too much of a problem, as the user can then just fetch and change after
until they find new posts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.