Successfully reported this slideshow.

Faking Data

0

Share

Upcoming SlideShare
Ancillary tasks - Magazines
Ancillary tasks - Magazines
Loading in …3
×
1 of 22
1 of 22

More Related Content

Faking Data

  1. 1. Faking Data (Building a Real-looking Demo Account) Philip Sharp @philipsharp Clearspring / AddThis DC PHP July 13, 2011
  2. 2. Screenshots are useful... <ul><li>Features/Tour
  3. 3. Help
  4. 4. Marketing </li></ul>
  5. 5. Screenshots are not a demo. Nor do they keep themselves up-to-date. (The same thing goes for videos.)
  6. 6. Neither is a free trial.
  7. 7. We collect data. People want to see how it looks up-front. (We're not all Google. GA doesn't need a demo.)
  8. 8. A good demo requires good data. (Chartbeat is lucky. But we can't all show Fred Wilson's data.)
  9. 9. Obfuscate if you can. demoPayees = [“Joe's Widgets”, ” ACME Explosives”, “ Frank's Fish Fry”] transaction = { “ datetime”: “2011-07-13 18:52:22” “ payee”: “Churchkey”, “ ammount”: 145.23 } transaction.payee = demoPayees[rand(0,2)];
  10. 10. Make your own if you can. { “ username”: “frodo” “ name”: “Frodo Baggins” rings: 1 }
  11. 11. Some data doesn't cooperate. <ul><li>URLs
  12. 12. Titles </li></ul>
  13. 13. Big Data GET /atapi/pub/shares/content?pubid=xa-4e1df9914f1a6d69 &dates=110706-110712&type=bm%2Cem%2Cfl%2Cif%2Cab &domain=www.example.com&range=0%2C20 [[&quot; http://www.example.com.com/blog/2011/07/big-news &quot;,&quot;Example Blog :: Big News&quot;,4990]]
  14. 14. Choose Your Inputs <ul><li>Services (top 50)
  15. 15. Countries (top 50)
  16. 16. Ruleset: </li><ul><li>Domain
  17. 17. URLs
  18. 18. Keywords
  19. 19. Referers </li></ul></ul>
  20. 20. 'demo-oz-emeraldcity' => array ( 'emeraldcity.gov.oz' => array ( 'target' => 5000 , 'urls' => array ( array ( '/' , 'The Emerald City' ), array ( '/tourism' , 'The Emerald City - Ozapos;s Premiere Road-Trip Destination' ), array ( '/tourism/things-to-do' , 'The Emerald City - Things to Do' ), array ( '/tourism/things-to-do/balloon-rides' , 'The Emerald City - Things to Do - Balloon Rides' ), array ( '/tourism/things-to-do/horse-rides' , 'The Emerald City - Things to Do - Horse Rides' ), array ( '/mayor' , 'The Emerald City - Mayorapos;s Office' ) ), 'referers' => array ( '' , 'google.oz' , 'bing.oz' , 'yahoo.oz' , 'search.oz' ), 'keywords' => array ( '' , 'oz' , 'vacations' , 'green' , 'emerald' , 'sunglasses' ) ), 'wizard.oz' => array ( 'target' => 3000 , 'urls' => array ( array ( '/' , 'The Wizard of Oz' ), array ( '/the-wizard' , 'The Wizard of Oz :: The Wizard' ), array ( '/seeking-audience' , 'The Wizard of Oz :: Seeking Audience With The Wizard' ), array ( '/contact-us' , 'The Wizard of Oz :: Contact Us' ) ), 'referers' => array ( '' ), 'keywords' => array ( '' ) ) ),
  21. 21. foreach
  22. 22. $shareMagnifier = $countrySharePercentage * $serviceSharePercentage * $browserSharePercentage / 100000; $combinationTarget = $domain['target'] / count($domain['urls']) / count($domain['referers']) / count($domain['keywords']); $dayMultiplier = (($daysOfData - $day) / 100) + 1; $combinationShares[-$day] = floor(rand(1,100) * $shareMagnifier * $dayMultiplier * ($combinationTarget / 50));
  23. 23. The Result
  24. 24. Using It Demo Accounts Demo Profiles
  25. 25. OOP to the rescue. /** * Hydra Package API demo wrapper * * @author philip * @requires Zend Framework */ class AT_Hydra_Package_Service_Demo extends AT_Hydra_Package_Service { … } $dataModel->setService(new AT_Hydra_Package_Service_Demo());
  26. 26. But wait, there's more. <ul><li>Browsers and Operating Systems
  27. 27. Last 24 Hours </li></ul>
  28. 28. This...
  29. 29. Looks like...
  30. 30. $radian = ($minute / 1440) * 2 * M_PI + (1.25 * M_PI); $sin = sin($radian) + 1.05; $shares = round(rand(1,100) * $sin * $shareMagnifier * $combinationTarget);
  31. 31. Dangers <ul><li>0.00000001 * [Just about anything] is a really small number </li></ul>

Editor's Notes

  • Who am I. What we do.
  • People want to see the product. Our people want to show it off.
  • (save, edit, publish) manually, automatically
  • Point your site to a demo db.
  • Hard to obfuscate. Tedious to make manually.
  • cant store random stuff explicitly by-day
  • Date is rolling
  • passthrough where ok override where ok reformat data
  • ×