Building Twitter in Drupal

17,581 views

Published on

Cloning the Twitter web site in Drupal: how you can do it, and why you don't want to! From the Do It With Drupal conference.

Published in: Technology
3 Comments
13 Likes
Statistics
Notes
  • There are still reasons a site might want to do this. It is nice to know you did it, but would be even better if you made a Drupal module with the code you made. If you don't want to use it, that's fine, but others might.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Building Twitter in Drupal 7 ? I need help :(
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Great! But doesn’t explain how to do it
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
17,581
On SlideShare
0
From Embeds
0
Number of Embeds
171
Actions
Shares
0
Downloads
0
Comments
3
Likes
13
Embeds 0
No embeds

No notes for slide

Building Twitter in Drupal

  1. 1. ...in Drupal
  2. 2. What that means
  3. 3. What that means How we did it
  4. 4. What that means How we did it Why you shouldn’t
  5. 5. So… what is Twitter? • Streamlined info flow • 140 character messages • Just your friends • ...And eighty jillion users
  6. 6. Twitter is growing. Source: Jason Kottke (http://www.kottke.org/07/05/growth-of-twitter-vs-blogger)
  7. 7. Twitter is simple.
  8. 8. No, really. Simple. Public User's Friends' Timeine Page Posts Individual Favorites Update Post List Form
  9. 9. What can users do?
  10. 10. What can users do? • Post an update
  11. 11. What can users do? • Post an update • Follow a user
  12. 12. What can users do? • Post an update • Follow a user • Bookmark a post
  13. 13. What can users do? • Post an update • Follow a user • Bookmark a post •…
  14. 14. What can users do? • Post an update • Follow a user • Bookmark a post •… • Profit!
  15. 15. Why rebuild Twitter? Image: Exploding Dog (http://www.explodingdog.com)
  16. 16. Why rebuild Twitter? • “Sandboxed” communication Image: Exploding Dog (http://www.explodingdog.com)
  17. 17. Why rebuild Twitter? • “Sandboxed” communication • Integration into a larger site Image: Exploding Dog (http://www.explodingdog.com)
  18. 18. Why rebuild Twitter? • “Sandboxed” communication • Integration into a larger site • The simplicity challenge Image: Exploding Dog (http://www.explodingdog.com)
  19. 19. Why rebuild Twitter? • “Sandboxed” communication • Integration into a larger site • The simplicity challenge • Because it was there Image: Exploding Dog (http://www.explodingdog.com)
  20. 20. What hath Drupal wrought?
  21. 21. What hath Drupal wrought? • The actions (post, follow, favorite)
  22. 22. What hath Drupal wrought? • The actions (post, follow, favorite) • The views (timeline, friends, favorites)
  23. 23. What hath Drupal wrought? • The actions (post, follow, favorite) • The views (timeline, friends, favorites) • The Simple™
  24. 24. What hath Drupal wrought? • The actions (post, follow, favorite) • The views (timeline, friends, favorites) • The Simple™ • ...In 24 man-hours.
  25. 25. What hathn’t Drupal wrought?
  26. 26. What hathn’t Drupal wrought? • Some layout details
  27. 27. What hathn’t Drupal wrought? • Some layout details • The SMS (SMS module)
  28. 28. What hathn’t Drupal wrought? • Some layout details • The SMS (SMS module) • The API (Services module)
  29. 29. What hathn’t Drupal wrought? • Some layout details • The SMS (SMS module) • The API (Services module) • The Community (magic)
  30. 30. What did we just see?
  31. 31. What did we just see? • One content type
  32. 32. What did we just see? • One content type • Two flags
  33. 33. What did we just see? • One content type • Two flags • Four helper modules
  34. 34. What did we just see? • One content type • Two flags • Four helper modules • Five views
  35. 35. What did we just see? • One content type • Two flags • Four helper modules • Five views • 200 lines of custom PHP
  36. 36. What did we just see? • One content type • Two flags • Four helper modules • Five views • 200 lines of custom PHP • One custom theme
  37. 37. The content type • No title, no options: just a body field. • Custom page.tpl.php in the theme
  38. 38. The sidebar • Two blocks • Defined by module • 50-60 lines of PHP • Faster, but brittle
  39. 39. Friends and favorites • “Following” flag • “Favorite” flag • Works cleanly with Views
  40. 40. The update form • Custom form in our module • Simple validation • Twitter’s Javascript
  41. 41. The listing pages • Views module • blittr.com/[list-style]/[username] • Filtered by Flags
  42. 42. The look and feel!
  43. 43. The look and feel! • Duplicates Twitter’s HTML • Uses Twitter’s CSS • Ignores the majority of Drupal’s data • Seven replacement templates views fields) (page, page-node, block, node, views-table,
  44. 44. The other bits • SMS Framework module • Services module • Mobile theme • Personal CSS skins • Privacy
  45. 45. The other bits • SMS Framework module • Services module • Mobile theme • Personal CSS skins • Privacy
  46. 46. Yay!
  47. 47. This was a Terrible Idea
  48. 48. Drupal is not (just) a framework
  49. 49. Drupal’s mastery curve can be steep
  50. 50. Drupal is not an island
  51. 51. Drupal is a powerful tool
  52. 52. Re-use the techniques
  53. 53. Don’t rebuild Twitter...
  54. 54. Don’t rebuild Twitter... in any system!

×