สวัสดีครับ
เมื่อวานนี้ (28/5/2009) ผมพูดถึง Google Web Elements ที่ช่วยให้เราสามารถ embed Google products ลง website หรือ blog ได้สะดวกขึ้น หนึ่งในนั้นก็คือ Spreadsheet ใน Google Docs วันนี้พวกเราลองมาสร้าง Twitter Update โดยใช้ Spreadsheet และ embed ลง website หรือ blog ด้วย Google Web Elements กันครับ
1. Log In บัญชี Twitter ของเราและ copy RSS Updates Feed link จาก sidebar ของหน้า twitter
2. Open New Spreadsheet และเปลี่ยนชื่อ sheet1 ตามที่่ต้องการ (ชื่อนี้จะถูกแสดงอยู่ใน Twitter Update ที่เราสร้างขึ้น)
3. ใส่ Code ตามนี้ =ImportFeed("http://twitter.com/statuses/user_timeline/xxxxxxxx.rss", "items title", FALSE, 10) ลงใน Cell แรกของ Spreadsheet (Cell A1) แทนค่า xxxxxxxx ด้วยหมายเลขจาก RSS Updates Feed link ในข้อ 1 (อ่านรายละเอียดการใช้ function 'importFeed' ได้จาก: http://docs.google.com/support/bin/answer.py?hl=en&answer=75507 )
4. ปรับสีของ font และ background รวมทั้งความกว้างของ cell ตามที่เราต้องการซึ่งหน้าตาของ spreadsheet ก็จะประมาณที่เห็นตามภาพครับ
5. Copy URL ของ Spreadsheet นี้จาก Address Bar และ paste ในช่อง URL Box ของหน้า Google Spreadsheets Element ปรับ size (สามารถปรับขนาดให้เหมาะสมจาก code ในภายหลัง) กำหนด Cell Range ด้วยค่า A1:A10
6. Copy Code และนำไป paste ใน Website หรือ Blog ของเราได้ทัีนที ตามภาพตัวอย่างครับ


0 Comments:
Post a Comment