Showing posts with label Postgres. Show all posts
Showing posts with label Postgres. Show all posts

Sunday, April 22, 2012

Buying, Selling, and the New Server

With php-back end and game logic, we have implemented the ability to buy and sell shares of predictions, along with the associated transferal of money.  You can also remove bids.  May need to do some debugging.  Very close to being able to decide predictions; all that's missing is the transfer of money.

Were given a new server thanks to George Lee and Steven Low; spent some time setting up http, ssh, php, and postgres.  Still trying to work out how to link it to the sites and stuff.  Will eventually be at 4sight.wil.caltech.edu .  Trying to figure out how to setup a database with the same name as our old one and no password required.

Friday, April 13, 2012

More Website Stuff

Moving to the Home page from another tab is now noticeably faster than re-loading it; the website now only needs to load everything the first time you visit.  In addition, we added a new table to keep track of users' friendlists and only need to record those once.  There are a few more tables in the database for keeping track of some things, but they haven't been filled with stuff yet.

Also fixed a few minor errors.

Saturday, April 7, 2012

Viewing Predictions and Making Bids!

We now have an admittedly clunky interface to look at the current predictions and make bids on them via PHP/Postgres. We will eventually have more questions than the ones posted now. Take a look at http://ugcs.caltech.edu/~alexf/test.php.

Friday, April 6, 2012

More Website and Postgres Stuff

Website now automatically adds users to the users database.  Right now, for testing, it also prints out a list of all users and their stats.

Website also lists the predictions a user owns, but the database is still empty, so there's no way to test it yet.

Added a new page to add or remove predictions from the database as well as list all predictions.


Wednesday, April 4, 2012

Progress on Database and Website: Friendslist

Now able to retrieve friends lists of users at http://ugcs.caltech.edu/~alexf/test.php.
Used http://developers.facebook.com/docs/reference/api/ to learn how to extract the information.

Created tables with php and postgres according to schema in previous blog post.  Four tables named "users", "owned", "bids", and "predictions".  It turns out that the Postgres on UGCS is not fully up-to-date. We didn't check for sure, but it seems to be ~8.1, not 9. Also have a page with buttons to create and delete them for testing purposes.  Link not given.

Connecting with Facebook and Verifying Postgres

Using Alex's UGCS account, we were able to authenticate/authorize with the Facebook API, extracting the user ID. The Graph API is very useful for accessing this data. At the same time, we were able to access the Postgres database on UGCS by creating and dropping a table.

You can check out our Facebook test app at: http://ugcs.caltech.edu/~alexf/test.php

One interesting setback seems to be that UGCS does not support HTTPS since it lacks a trusted SSL certificate. Unfortunately, we will probably need to find a new location to host our site.