Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Making a JSON API

Name: Anonymous 2012-09-26 21:12

So I've worked on a few group projects now where an online API is needed. Every single time there is someone in the group who has built their own for some other project they've and volunteers to take care of the server side part.

Lately I've been wanting to do my own small side projects but I've realized I know fuck all about the server side. I have a little knowledge of php and mySQL and have done little minor things with WAMP, but I have no idea how to do things like scrape a website or read in a bunch of files to get mass amounts of information in to the database and to perform this regularly/automatically. Any help on this specific part, preferably that can be done on a Windows machine while I'm learning?

Name: Anonymous 2012-09-26 21:46

That was LEAH CULVER QUALITY!

Name: Anonymous 2012-09-26 22:12

Thanks for the help and not being a stereotype

Name: Anonymous 2012-09-26 22:22

WAMP
Windows
Apache
MySQL
PHP

Fuck off back to /g/ ``please''.

Name: Anonymous 2012-09-26 22:30

>>4
If I have WAMP don't you think I know what it includes? Why are you being such an ass?

Name: Anonymous 2012-09-26 22:39

>2011
>not using node.js

Name: Anonymous 2012-09-26 22:43

>2010
>not using ruby on sinatra on event machine

Name: Anonymous 2012-09-26 22:46

>2012
>not using SAP ERP

Name: Anonymous 2012-09-26 22:49

>2013
>not using LISP DSLs for everything

Name: Anonymous 2012-09-26 22:55

>>5
PHP has a reputation for attracting amateurs.  It's fucked, google "PHP is a fractal of bad design" if you want an overview. 

For complex tasks, you're going to have to break it down, test, and then integrate with what you've got.  Doing it like this helps with splitting up workloads and shit that needs to be done.

1st, find a way to scrape the sites you're looking at.  Python and especially Perl (the other P in a L/M/WAMP stack) excel at handling this type of work.  Try and find a way to scrape a site (4chan's image boards are good to practice on).  PHP is too slow and inefficient for this task.  Your goal should be to be able to get the data formatted in a regular old text file.  You can change up the implementation once you get a little success here. 

2nd, you'll need to have a site set up to process the data you want.  Make sure you know a bit about MySQL and play with it a bit before you set up queries.  Python/PHP/whatever can work for sending/fetching query results.  Using a dev server on your own computer should be enough to get it right.

3rd, get rid of the Windows and use da Linux.  Then set up some cron jobs to automate your workflow. 

THis is just me talking out my ass.  Use a test set to troubleshoot each part so that when you bring them together, it will work with few errors.

Name: Anonymous 2012-09-27 0:16

>>5
>Windows
Use Linux.

>Apache
Use thttpd.

>MySQL
Use sqlite.

>PHP
Read SICP.

Name: Anonymous 2012-09-27 1:02

Windows
FreeBSD
Apache
lighttpd
MySQL
PostgreSQL or MongoDB, no half-measures
PHP
Java, C++, Scala, or LLVM

Name: Anonymous 2012-09-27 1:06

to answer your question, use curl to scrape sites and mysql/sql of choice to manage data (assuming you know sql). there are some native apis like pdo for that.

then install easyphp to run a no-config server on windows

but seriously
php
2012
not nodejs

Name: Anonymous 2012-09-27 1:33

PHP/SQL is no longer a good stack for beginners imo. Master JavaScript and stick with HTML5+nodejs as >>13-san says. While the entire web-as-a-platform idea is horrible, it's probably the easiest way to start programming for newbies (who usually just want a site or an app anyway).

But know that it's amateurville online; people are reading tutorials written by people who've watched screencasts of people showing hello world apps written by people who barely have any understanding of the issues at all. Meanwhile everybody is in the same boat: uneducated, "self taught" programmers who spend most of their time reinventing the wheel and dealing with problems that were solved 40 years ago.

Of course it doesn't need to be like this! So make sure you invest in your fundamentals, don't spend all day reading about the newest and greatest.

</guru out

Name: Anonymous 2012-09-27 2:57

Thanks for the useful information. I know Java pretty well, but really don't know much about web development. I only started learning php since that was what people around me in college had used before. I'll look into working on my JS skills instead

Name: Anonymous 2012-09-27 3:39

MongoDB
Doesn't this database have a bad rap for like I dunno, forget things? SEPPLES QUALITY
http://pastebin.com/raw.php?i=FD3xe6Jt

Name: Anonymous 2012-09-27 4:03

>>16
Some people really tried to use that for business? If they asked me, I would have told them that MongoDB's only use case is [Show HN] - Please upvote my awesome web app.

Don't change these.
Name: Email:
Entire Thread Thread List