HappyKardashian.com for #FVCP

435 views

Published on

Demo of HappyKardashian.com where on puts in their anniversary to see how many Kardashians they are.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
435
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

HappyKardashian.com for #FVCP

  1. 1. HappyKardashian.comFox Valley Computing Professionals
  2. 2. Why?Full-time backend developer w/StraightNorthSite required to fill multiple needs● Learn new technologies● Site needed to be built over lunch hours● Site needed an element of "fun"
  3. 3. Fun Site / Fun Tech● Red Hats OpenShift● RedBean ORM (Object Relational Manager)● Twitter Bootstrap (front-end framework)● Twitter OAuth
  4. 4. Red Hat OpenShift hostingopenshift.redhat.com● Free developer cloud server● git/ssh/shared ssl● JBoss/Node.js/Perl/PHP/Python/Ruby/...● Drupal/Cake/Ruby/Wordpres/...● MySQL/MongoDB NoSQL● Cron/phpMyAdmin
  5. 5. RedBeanPHP ORM Libraryredbeanphp.comObject Relational MapperAutomatically:● generates tables● columns● foreign keys● no XML, YAML or ini files...just one file● easy for fast development
  6. 6. RedBeanPHP Sample OverviewAll database structures will be generatedautomatically, on-the-fly, by RedBeanPHPrb thinks in what it calls beans -plain old PHP object with public properties
  7. 7. RedBeanPHP Sample Initializationrequire(rb.php);// for SQLiteR::setup(); // for mysqlR::setup(mysql:host=localhost;dbname=database,user,password);// PostgreSQL available as well// only InnoDB
  8. 8. RedBeanPHP happykardashian.com$find = R::findOne(anniversary, "twitter = ?", array($_REQUEST[twitter])); if(!isset($find)){ $bean = R::dispense(anniversary); $bean->twitter = $_REQUEST[twitter]; $bean->anniversary = $start_date; $bean->anniversaries = $anni_data; R::store($bean); }else{ $bean = R::load(anniversary, $find->id); $bean->twitter = $_REQUEST[twitter]; $bean->anniversary = $start_date; $bean->anniversaries = $anni_data; R::store($bean, $find->id); }
  9. 9. Twitter Bootstraptwitter.github.comHTML & CSS-based design templates for:● typography● forms● charts● naviation● Responsive!
  10. 10. Twitter OAuth API Fundev.twitter.com● Access level - Read & Write● Access token - <string>● Access token secret - <string>
  11. 11. Twitter OAuth initialconfig<?php$Key = abc;$Secret = 123;$Token = def;$SToken = 456;require_once(twitteroauth.php);
  12. 12. Twitter OAuth send that tweet!$tweet = new TwitterOAuth($Key, $Secret, $Token, $SToken);$msg = Happy . $kims . Kardashians!;$tweet->post(statuses/update, array(status => $msg) );
  13. 13. Thank you!Eric Michalseneric.michalsen@gmail.com@michalsen

×