Browse Source

restore old sorting

master
Jeffrey Paul 2 years ago
parent
commit
8d1db5c15e
  1. 9
      README.md
  2. 2
      hn/handlers.go

9
README.md

@ -2,9 +2,12 @@
Live: https://orangesite.sneak.cloud
Shows stories that were on the orangesite front page within the last 48
hours, but aren't any more. Sorted by the amount of time they remained on
the front page, smallest first.
Shows stories that were on the orangesite front page within the last 24
hours, but aren't any more. Sorted by when they exited the frontpage, most
recent first.
Stories on the frontpage for less than a half hour (likely manually
moderator nuked if rank > 25 or so) are marked red for convenience.
# TODO

2
hn/handlers.go

@ -24,7 +24,7 @@ func NewRequestHandlerSet(version string, db *gorm.DB) *RequestHandlerSet {
func (r *RequestHandlerSet) indexHandler(c echo.Context) error {
last24h := time.Now().Add(time.Second * 86400 * -1)
var fpi []HNFrontPage
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Select("*, ( strftime('%s',disappeared) - strftime('%s',appeared)) as hangtime").Order("hangtime asc").Find(&fpi)
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Order("disappeared desc").Find(&fpi)
type fprow struct {
Duration string

Loading…
Cancel
Save