#indieweb 2020-04-20

2020-04-20 UTC
harmetic, [tantek], Diogo, KempfCreative, gRegorLove, Choscura, plut4rch, beko, craigo, kensp, [prtksxna], wolftune and cortexman joined the channel
KartikPrabhu, wolftune, Choscura, plut4rch, Nuve, PetriBot, [schmarty], markopasha, nickodd, opal, kensp, jussi^ and swentel joined the channel; cortexman left the channel
#
sknebel
good morning!
#
Loqi
rise and shine!
[prtksxna] joined the channel
#
[prtksxna]
Morning sknebel!
loicm joined the channel
#
plut4rch
im trying to create a dynamic web application where users can view and post meetings, all on a single page that doesn't reload. My first step was learning how to make asynchronous GET requests in JS, and transform the JSON into HTML and update the DOM. My next step has been attempting to create a backend in PHP that returns JSON, and I'm a bit lost. I was thinking of having a series of scripts on my web server that when
#
plut4rch
called appropriately from the front-end, return a JSON response. For example, I might have, getmeetings.php, which when invoked with a GET request and several properties such as how many meetings to return, will access my database and return JSON as a response. And then I might have another script, like addmeeting.php, which performs a similar action. Does this seem like a pretty bad way to go about things? I know for
#
plut4rch
starters, it's not very secure, and the URL's aren't exactly 'restful' or 'clean'. If i wanted to transform these scripts into an API of sorts, such that I could invoke the same functionality but with a cleaner URL, i.e. instead of /addmeetings.php, /meetings with the appropriate restful request, would I go about this by creating a FrontController, or some type of Controller where all the requests would be directed to, then
#
plut4rch
interpret the /meetings url, and invoke /addmeetings.php document that way? Sorry if I have explained this confusingly.. I'm a bit lost. I have had a look at the Flask microframework and it seems so easy to just create an endpoint and return JSON, and I want to do the same thing with PHP, or any scripting language on a web server, because my application is by nature very simple and I dont want to invest in learning a big
#
plut4rch
framework just yet.
#
jeremycherfas
Good morning IndieWeb [prtksxna] sknebel
[LewisCowles] joined the channel
#
[LewisCowles]
plut4arch you are talking about routing
#
[LewisCowles]
and there is no one way to handle it.
#
plut4rch
LewisCowles ahh i see, so should i look up routing techniques? what does routing have to do with a controller? thats something im also confused about
#
[LewisCowles]
using separate files like that might be as simple as creating a new file which scans the $_SERVER['REQUEST_METHOD'] for 'GET' or 'POST' and then the path via $_SERVER['PATH_TRANSLATED'] (or whichever $_SERVER variable you have transmitting the path) equal to '/meetings', then include the requisite file.
#
[LewisCowles]
You'd then need to modify your web-server to route at least '/meetings' to that new file.
#
[LewisCowles]
That'll get old real fast, but it's the simplest central router, and being you don't have query string parameters mentioned here it'll be fine to leave body parsing etc to the respective individual PHP files
#
[LewisCowles]
Routing has nothing to do with controllers unless you are using an MVC project created by someone who knows nothing of the history of MVC (most people that use it)
#
[LewisCowles]
#dev might be a better place than #indieweb to ask these questions also
#
plut4rch
cool :)) thanks for you help, that explanation of a rudimentary router is quite helpful.
#
plut4rch
MVC is everywhere but i feel like it might be overkill for me to structure my simple API like that
#
plut4rch
but i dont really know
#
[LewisCowles]
btw I made a mistake '_REQUEST_URI' is the name you'll want for the path._
#
[LewisCowles]
We have a thing in some circles called avoid it until it hurts, then make choices. For now a GET and a POST route with no query params seems fine.
#
[LewisCowles]
If your app gets huge, if you like a framework or not, it might be an idea to go along with them for productivity sake
#
plut4rch
if i do want to include query params in a get request, then i guess i could just create a regex for REQUEST URI to get those values right?
#
KartikPrabhu
yeah this is really for #indiewedev
#
plut4rch
oh sorry :s
#
KartikPrabhu
oops #indieweb-dev channel
#
[LewisCowles]
let's continue in dev
#
plut4rch
ok let me join that channel
#
KartikPrabhu
plut4rch: no need to apologise. all good :)
#
[LewisCowles]
which is for me called dev and for you called indieweb-dev lol
#
KartikPrabhu
[LewisCowles]: yeah slack thing I guess
[jgmac1106] joined the channel
#
[jgmac1106]
we should look through those for keywords to trigger loqi dev nudge
#
Loqi
agreed.
#
[LewisCowles]
I think answer in place and redirect is less hostile
#
[LewisCowles]
I had redirected them already. The group nudge was appreciated
#
[jgmac1106]
I know just like looking for the triggers, more out of amazement that nothing in the convo made loqi ask you to move...
#
[jgmac1106]
morning all, should have started with that
#
jeremycherfas
Mornin [jgmac1106]
#
[LewisCowles]
👋 hello
plut4rch, [xavierroy], anotheryou, loicm, tomasparks, jussi^, KempfCreative and [LewisCowles] joined the channel
#
[jgmac1106]
Okay feed grooming is a PITA, going to see if an inoreader browser extension helps, takes me like a day and half before things get all of wack in my rss reader...simplifying the follow work flow....will let you smart folks figure that out
#
Zegnat
What does feed grooming entail?
[Michael_Beckwi] joined the channel
#
[jgmac1106]
finding a new blog, adding to reader, choosing the correct folder, and then maybe hopefully adding manually to my /following page,...or vice versa..but not making you RSS reader so unwieldly you walk away...
#
[jgmac1106]
so many times I see a new blog to follow but know to stop what I am doing open my feed reader, enter in the url, find the correct feed to follow and then put feed into correct folder...I often just say "next time" knowing one probably won't come
#
[jgmac1106]
We will see if the browser extension helps
crowdhailer[m] and plut4rch joined the channel
#
j605
for me the issue there are too many stories on the unread list that it is sometimes intimidating to open the reader
#
[LewisCowles]
j605 you never get that number down if you don't read.
#
j605
[LewisCowles]: I was not doing it for sometime. I started back again last week so it looks much better
#
j605
you're right though. I need to read more
#
sknebel
my counter isn't going up, Inoreader caps at 9999 :P
#
j605
last week I also finally finished a book I started about 2 months back and started another one
#
[jgmac1106]
j605 I was gonna say that. I might look for a clear al, unread after X time...especially jarring with my feeds of student writing...maybe I don't want to see the number of unread ever...it does cause a panic in me as well
#
sknebel
(with a paid account. with a free one the counter afaik only goes to 999, which I found funny)
#
[LewisCowles]
sknebel is it just the counter or does it refuse to store more?
#
[jgmac1106]
I do have an unused paid Feedly account if anyone wants it
#
sknebel
[LewisCowles]: counter. but they have a time limit on how long they keep stuff unread too. which I find a bit annoying
#
j605
I have query feed which limits by age for news
#
j605
so I just mark everything else as read and move on since it is just news, hehe
#
jeremycherfas
One of the reasons I like a reader (Newblur) is that I can skim loads of headlines (about 200 a day) and read only those that interest me. Which means I generally have no more than 1-2 unread at the end of the day. And those are usually things I want to process more thoroughly.
jussi^, nickodd, electronicmaji, andysylvester, plutes, mauz555 and sp1ff joined the channel
#
Zegnat
I always have my reader (NetNewsWire) open when I am at my desk. So it really does not take me a lot of time to subscribe to an extra feed. And during the subscribe flow it lets me pick a folder so that step adds nearly no overhead
#
Zegnat
The most annoying thing is syncing my YouTube subscriptions. I should automate that.
petermolnar, wolftune, KartikPrabhu, jdp, mauz555, lennykravitz, [KevinMarks], gRegorLove, bigbluehat, swentel, [jgarber], markopasha, bkardell, jussi^, awolf and [tantek] joined the channel
#
[tantek]
Welcome [Molly] !
[Molly] joined the channel
#
[Molly]
[tantek] Hi! Thanks for the welcome! Excited to be here
loicm, emilbayes, turona and awolf joined the channel; nickodd left the channel
#
[tantek]
Awesome! How did you find us [Molly]?
emilbayes joined the channel
#
[Molly]
[tantek] my University suggested we read an article on The New Republic called Reboot The World by Paul Ford where you were mentioned!
#
[Molly]
I have been planning to set up my own portfolio website, and was doing some research as I want to build something that is more than just another portfolio site - something that allows me to have control and ownership over my online identity whilst still remaining connected to the platforms or ‘silos’ I have used in the past
#
[Molly]
I couldn’t have even imagined a better resource than indieweb for this so here I am :)
lahacker joined the channel
#
[tantek]
Amazing! Paul Ford is great, he participated in our IndieWebCamp NYC event a few years ago. I don't think I've seen the New Republic article - do you have a link handy?
#
[Molly]
Oh wow, super cool!
#
[Molly]
Here’s the link:
rmdes, andysylvester, kensp, turona, leg, [jgmac1106], [Aaron_Klemm], deathrow1, opal, [KevinMarks], plut4rch, awolf, en3r0_ and Decobus joined the channel; leg left the channel