GreenInfo-Network / caliparks.org

Mapping social media in parks and other open spaces
http://www.caliparks.org/
22 stars 3 forks source link

Wander function not working #648

Closed gregallensworth closed 7 years ago

gregallensworth commented 7 years ago

The Wander link is not working.

Seems the API is trying to find a random park which had a photo within the last month:

https://github.com/GreenInfo-Network/caliparks.org/blob/a15ab39d386b3a087072ea889c3c782631b28971/app/server/server.js#L354

See what could be done to remove the "last month" filter, and return a random park? Performance shouldn't be bad.

Though Sean follows up, that perhaps it's not using that interval but a hardcoded one:

https://github.com/GreenInfo-Network/caliparks.org/blob/parksforward-redesign/app/server/services/queries/parks.js#L244

Then follows up, that one needs to change these lines:

https://github.com/GreenInfo-Network/caliparks.org/blob/parksforward-redesign/app/server/services/queries/parks.js#L260-L262

sconnelley commented 7 years ago

I probably meant to use the interval option but never got around to implementing it, sorry :-(

sconnelley commented 7 years ago

The "wander" button on the home page actually routes to "/wander" then redirects to parks page. https://github.com/GreenInfo-Network/caliparks.org/blob/a15ab39d386b3a087072ea889c3c782631b28971/app/server/server.js#L224-L232

clhenrick commented 7 years ago

Currently it's not even hitting the express route as it's missing a route in routes.jsx: https://github.com/GreenInfo-Network/caliparks.org/blob/a15ab39d386b3a087072ea889c3c782631b28971/app/public/routes.jsx#L12-L27

clhenrick commented 7 years ago

Actually I see it doesn't need a route, as the Nav component creates the link. Slightly confusing that routes for /discover and /explore point to the 404 page and that /wander was missing from Routes.jsx. The first two should probably redirect to the home page as /#discover and /#explore, although when you refresh the page with either of those in URL it doesn't scroll to the correct section, but that's another issue.

Fixed the SQL query by removing the WHERE clause on the SELECT * FROM instagram_photos and tacking on a LIMIT 500 as to not grab millions of photos. There's probably a better way to make the query return rows that are more randomized.

danrademacher commented 7 years ago

I just tried this on live site and I'm still getting 404 when I click on or load http://www.caliparks.org/wander

Does this fix still need to be deployed?

clhenrick commented 7 years ago

Don't think I pushed the fix to the production server, will do that later today.

-Chris clhenrick.io

On Mon, Apr 17, 2017 at 6:07 AM, Dan Rademacher notifications@github.com wrote:

Assigned #648 https://github.com/GreenInfo-Network/caliparks.org/issues/648 to @clhenrick https://github.com/clhenrick.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GreenInfo-Network/caliparks.org/issues/648#event-1044953628, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ31BS79m0NHtGDCAJZxb6aiWu-qiFGks5rw2P5gaJpZM4MI8Ag .