Code Monkey home page Code Monkey logo

Comments (5)

ghostwriternr avatar ghostwriternr commented on September 25, 2024

Oh, yes. The dates are directly from the noticeboard itself. The reason I didn't add a time field to the database was that:

  1. The time formats are inconsistent between the noticeboards.
  2. One of the noticeboards (http://www.iitkgp.ac.in/for-students) has no timestamp.

We could add timestamps based on the time at which the new notice was found by the scraper, but then we'd have to handle all the older notices separately. And using the one included in the notice would mean we'd have to handle the 'no timestamp' noticeboards separately. Both of which, in my opinion, aren't high priority problems.

Besides, the API currently returns the notices in latest-first fashion (latest as defined by higher position in the original noticeboard), which seems consistent enough to me.

Is there any case that I might be missing which would be worth going through all this trouble to get the order right?

from dashboard.

ghostwriternr avatar ghostwriternr commented on September 25, 2024

Also, I think this issue would make more sense in the API repository: https://github.com/metakgp/veritas
(As a side note, the scraper code lives here: https://github.com/metakgp/hermes. The reason for this separation is explained in the README.)

from dashboard.

kektobiologist avatar kektobiologist commented on September 25, 2024

So right now the notices are persisted in redux, and new notices are fetched when tabs are switched (so that we always have fresh notices) and merged with existing list of notices. After merging, it would be good to sort the notices again so that new ones are at the top. We can probably do this with _id field (mongodb _id is just a timestamp of document creation) but maybe you can figure out something better

from dashboard.

ghostwriternr avatar ghostwriternr commented on September 25, 2024

Oh, I see. Yep. That makes sense! Good suggestion.

I am indeed using the _id fields to fetch the latest notices. I'll return that as well in the GET request.

from dashboard.

ghostwriternr avatar ghostwriternr commented on September 25, 2024

Actually, the API is indeed already returning this. My bad!

from dashboard.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.