This document provides an outline for a tutorial on the facebook JavaScript SDK. It introduces the SDK and covers the following topics:
- An overview of the Facebook developer site, apps, components, and authentication process
- Technical details of the SDK, including how to use the Graph API, callbacks, and RESTful API model
- Facebook developer tools like the Graph API explorer and access token tool
- A code lab section that provides examples of integrating the SDK, authenticating users, accessing the Graph API, and using social plugins and dialogs
Web 2.0: What Can It Offer The Research Community?lisbk
What are the implications of Web 2.0 for the research community? In this presentation Brian Kelly, UKOLN describes how various Web 2.0 technologies are being exploited within the higher education sector and more widely.
See http://www.ukoln.ac.uk/web-focus/events/meetings/pparc-2007-03/
A presentation by Houssem Yahiaoui about Firebase at the 11th of Algiers Tech Meetup on October 8th 2016 at Djezzy Training Center Bir Mourad Rais, Algiers
This is a presentation I made at my local Northern Virginia Ruby Users Group. It discusses the install, setup and use of a few useful Ruby on Rails plugins.
How to build Android Chat App with Firebase for 2 hours?Nguyễn Bá Thành
This lecture for guide junior android to create an android app chat which for millions users use at the same time.
Technical
- Firebase
- Android
Tools:
- Android Studio
Author contact:
fb.com/thanhnb1101/
http://www.thanhnotes.com/
thanhnb1101@gmail.com
Web 2.0: What Can It Offer The Research Community?lisbk
What are the implications of Web 2.0 for the research community? In this presentation Brian Kelly, UKOLN describes how various Web 2.0 technologies are being exploited within the higher education sector and more widely.
See http://www.ukoln.ac.uk/web-focus/events/meetings/pparc-2007-03/
A presentation by Houssem Yahiaoui about Firebase at the 11th of Algiers Tech Meetup on October 8th 2016 at Djezzy Training Center Bir Mourad Rais, Algiers
This is a presentation I made at my local Northern Virginia Ruby Users Group. It discusses the install, setup and use of a few useful Ruby on Rails plugins.
How to build Android Chat App with Firebase for 2 hours?Nguyễn Bá Thành
This lecture for guide junior android to create an android app chat which for millions users use at the same time.
Technical
- Firebase
- Android
Tools:
- Android Studio
Author contact:
fb.com/thanhnb1101/
http://www.thanhnotes.com/
thanhnb1101@gmail.com
App Indexing: Blurring the Lines Between Your Website and AppJuan Gomez
You worked really hard to create a great Android app that provides a better experience for users accessing your content from their mobile devices. And yet most of your users still find themselves on your website being sent there by a Google search or a link they clicked on in an e-mail or another app (like the browser).
Don’t you wish there was a way to send those users back to your app instead?
Well, there is a way to do this, and it’s called App indexing. App Indexing allows you to connect pages from your website with specific content within your Android app. This enables users who have your app installed to open it directly from relevant mobile search results on Google.
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
See the Power of the WP API. Now that every WordPress website has (or will have) an API built-in, what can you do with it? It allows us to further separate the data from the code. Use WordPress to manage our data and then via the API easily access or update that data to power whatever we like. We’ll touch how to set it up and a handful of examples and then explore an iOS app pulling all it’s data and assets from a WordPress site via this API.
This will be geared for developers with some “how to” but also for everyone interested in the power of WordPress and where things are heading.
Learn how to spell WP-API
Learn about the power and flexibility it brings to WordPress
See it working in a live app
Deep dive into SharePoint 2013 hosted apps - Chris OBrienChris O'Brien
Covers key aspects of SharePoint 2013 apps, with a focus on SharePoint-hosted apps. Includes detail on app parts, using web parts within an app, configuring SSL, troubleshooting apps and possible reasons to move away from a SharePoint-hosted app to a cloud app. Also covers "high-privilege" apps which provision to the host web.
Atlassian is unveiling a new dashboard that will be added to all of our products, based on the OpenSocial specification. This session explores Atlassian's use of OpenSocial, and details the new Atlassian dashboards and Gadgets.
Atlassian Speaker: Tim Moore
Key Takeaways:
* Overview of OpenSocial
* Deep-dive on Atlassian dashboards and Gadgets
* Demos, how-tos and more
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Suzzicks
Emily Grossman's deck on app indexing from SMX East 2015 in New York. This deck covers:
- Why App Indexing?
- Google App Indexing for Android and iOS
- Apple Search App Indexing
IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...Dave Delay
By clearly separating IBM Domino data from the web page, Domino REST services can open the door to a new world of interactive web applications. Learn about emerging web standards, including Web Components, that reflect new paradigms and help you create more interactive web applications. Find out what's new in Domino REST services and see examples of state-of-the-art applications that combine emerging web standards and REST.
Introducing the JotSpot Data Model and APIScott McMullan
This preso introduces the benefits of adding structure to wikis and introduces how this is done in JotSpot wikis. It also provides a quick fly-over of the JotSpot API.
App Indexing: Blurring the Lines Between Your Website and AppJuan Gomez
You worked really hard to create a great Android app that provides a better experience for users accessing your content from their mobile devices. And yet most of your users still find themselves on your website being sent there by a Google search or a link they clicked on in an e-mail or another app (like the browser).
Don’t you wish there was a way to send those users back to your app instead?
Well, there is a way to do this, and it’s called App indexing. App Indexing allows you to connect pages from your website with specific content within your Android app. This enables users who have your app installed to open it directly from relevant mobile search results on Google.
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
See the Power of the WP API. Now that every WordPress website has (or will have) an API built-in, what can you do with it? It allows us to further separate the data from the code. Use WordPress to manage our data and then via the API easily access or update that data to power whatever we like. We’ll touch how to set it up and a handful of examples and then explore an iOS app pulling all it’s data and assets from a WordPress site via this API.
This will be geared for developers with some “how to” but also for everyone interested in the power of WordPress and where things are heading.
Learn how to spell WP-API
Learn about the power and flexibility it brings to WordPress
See it working in a live app
Deep dive into SharePoint 2013 hosted apps - Chris OBrienChris O'Brien
Covers key aspects of SharePoint 2013 apps, with a focus on SharePoint-hosted apps. Includes detail on app parts, using web parts within an app, configuring SSL, troubleshooting apps and possible reasons to move away from a SharePoint-hosted app to a cloud app. Also covers "high-privilege" apps which provision to the host web.
Atlassian is unveiling a new dashboard that will be added to all of our products, based on the OpenSocial specification. This session explores Atlassian's use of OpenSocial, and details the new Atlassian dashboards and Gadgets.
Atlassian Speaker: Tim Moore
Key Takeaways:
* Overview of OpenSocial
* Deep-dive on Atlassian dashboards and Gadgets
* Demos, how-tos and more
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Suzzicks
Emily Grossman's deck on app indexing from SMX East 2015 in New York. This deck covers:
- Why App Indexing?
- Google App Indexing for Android and iOS
- Apple Search App Indexing
IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...Dave Delay
By clearly separating IBM Domino data from the web page, Domino REST services can open the door to a new world of interactive web applications. Learn about emerging web standards, including Web Components, that reflect new paradigms and help you create more interactive web applications. Find out what's new in Domino REST services and see examples of state-of-the-art applications that combine emerging web standards and REST.
Introducing the JotSpot Data Model and APIScott McMullan
This preso introduces the benefits of adding structure to wikis and introduces how this is done in JotSpot wikis. It also provides a quick fly-over of the JotSpot API.
Facebook is a company that operates at massive scale. In this talk we’ll talk about how we use Python at Facebook.
Be it building back-end services, fast prototyping, automation, scaling operations, or simply gluing together various pieces of our infrastructure, Python is at the heart of it and allows our engineers to quickly deliver working solutions.
We’ll talk about our review process, unit testing, deployment workflow and various open-source framework we use.
O'Reilly and Safari Books Online Webinar on Facebook Application Development for Beginners, by Jesse Stay, The "Social" Geek. Talk to me if you want me to present to your organization!
Introduction To Facebook: Opportunities and Challenges For The Institutionlisbk
Slides used in a talk on "Introduction To Facebook: Opportunities and Challenges For The Institution" given by Brian Kelly, UKOLN at a meeting held at the University of Bath on 29 August 2007.
See http://www.ukoln.ac.uk/web-focus/events/meetings/bath-facebook-2007-08/
Walkthrough of the current (late April 2010) state of the Facebook Platform, given as a talk as part of the Facebook Developer Garage London workshop day at the Difference Engine in Middlesborough
Thinking of developing your very own Facebook Apps? Here is a basic guide to start and get to know the important elements of a Facebook application. (Samples are in Java)
Facebook Messenger Bot with Flask & Google App EngineNazrul Kamaruddin
This was a presentation at PyCon Malaysia 2016 on 27 August 2016 for beginners to get started building a Facebook Messenger bot using Flask and Google Cloud Platform.
Leveraging Rails to Build Facebook AppsDavid Keener
This presentation is a distillation of some of the practical tactics that David Keener's development team at MetroStar Systems has used to create highly successful FaceBook applications using Rails, including real-life systems like PollCast, Iran Voices and the Votridea Contest Platform. FaceBook is the world's largest social network, with over 500 million members.
This presentation is a distillation of practical tactics that have been used to create highly successful FaceBook applications using Rails, including real-life systems like PollCast, Iran Voices and Votridea. FaceBook is the world's largest social network, with over 600 million members. Key examples are in Ruby, JavaScript and straight HTML.
Nested List Comprehension and Binary SearchColin Su
Introduction to:
- Nested List Comprehension
- Binary Search implementation with Python
Python Programming for Non-programmer
Department of Computer Science, NCCU
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
4. Before We Start…
>
Google Moderator: http://goo.gl/OVNszf
Ask question here!
>
Code Lab Repo: https://github.com/littleq0903/fb-js-codelab
The code you will need it in the practice, check out the Wiki!
>
Turn your smartphone to the vibrating mode
facebook JavaScript SDK
9. Facebook App
The most basic unit for a developer on Facebook
>
>
Permissions
>
>
>
>
Insights
>
>
Developer
Facebook
App
Developer
Alert
>
>
>
>
Settings
>
>
Access Token
App ID
API Keys
Request Permissions
Developer Roles
Daily Report
Active User Statistic
Sharing Report
Breaking Changes
New Updates
Review Status
Domain Settings
Testing
Go to Production
facebook JavaScript SDK
10. Facebook Component
What can you do with Facebook JavaScript SDK?
>
Graph API - get data in and out of Facebook’s Social Graph
>
Login - authenticate Facebook users on your website
>
Social Plugins - don’t rebuild the wheel, take the power from
Facebook
facebook JavaScript SDK
11. Social Plugins
You know, that like button
>
Like Button
>
Activity Feed
>
Share/Send Button
>
Recommendations Box/Bar
>
Embedded Posts
>
Like Box
>
Follow Button
>
Registration
>
Comments
>
Facepile
facebook JavaScript SDK
13. Authentication
The Key to The Facebook World
>
Facebook - username and password
>
Facebook API - access token
>
Preventing server gets your credentials directly
facebook JavaScript SDK
14. Authentication
In The Real World Example…
Not easy to destroy when stolen
Username/Password
Easy to destroy when stolen
Access Token
facebook JavaScript SDK
15. Graph API
Data Form of Facebook, with RESTful API
>
Everything on Facebook forms a
graph
N
>
>
Your profile is an object, and has a
bunch of properties
Every object will have an ID as the
identity
am
e
y
thda
Bir
Me
Work
Ge
E-m
ail
nd
er
facebook JavaScript SDK
16. Graph API
Alice
Bob
Data Form of Facebook, with RESTful API
>
Some objects will be connected with
Relations
>
You could fetch more data on
Facebook through the relations
Friends
Photos
Me
Posts
“Today I go to…
“Damn, I hate
school…
facebook JavaScript SDK
19. What Can JavaScript SDK Do
>
Authentication
Server side cannot achieve this, the most important part of building Facebook apps
>
Interact with your website users
the thing could be done by ONLY JavaScript
>
Load Facebook pre-defined components
like buttons, comments, registration form in a second
>
Pre-defined functions from Facebook
out-of-box APIs and don’t rebuild the wheel
facebook JavaScript SDK
20. Authentication
Workflow of Authentication
Redirect user to FB
for authorizing your
app
Facebook response
user’s access
token to your
function
user type username &
password to login and
authorize
Rock it up!
JS SDK gets authorized
and feedback on the
interface or program
facebook JavaScript SDK
21. Authentication
>
FB.login()
tell Facebook it’s about time to start the authentication flow
>
FB.Event.subscribe(event, callback)
tell Facebook what to do when user got logged in
facebook JavaScript SDK
23. Callback Model
The most important part while using other’s JS library
>
>
one of JavaScript patterns
make sure action has been done
function
callback
Data
Could
you plz do this for
me?
Arguments
I’ve done, here
you go!
Job
Okay! I will tell callback
when I finished
facebook JavaScript SDK
24. RESTful API Model
>
HTTP Method: GET, POST, DELETE, PUT…
>
GET /user/{id}
Fetch the information of the user with id {id}
>
POST /user
Create a user
>
DELETE /user/{id}
Delete the user with id {id}
facebook JavaScript SDK
26. Graph API
A Simple GET Example
>
FB.api( graph_path , callback )
FB.api(“/me/posts”, function(response){
// will response an array in “data”
console.log(response);
});
{
"data": [
{post},
{post},
{post},
{post},
{post}
]
}
JavaScript
Result
facebook JavaScript SDK
27. Graph API
A Simple POST Example
>
FB.api( graph_path , type , options , callback )
var body = 'Reading JS SDK documentation';
FB.api('/me/feed', 'post', { message: body },
function(response) {
if (!response || response.error) {
console.log(‘Error occured');
} else {
console.log(‘Post ID: ' + response.id);
}
});
JavaScript
Post ID: 6892345
Result
facebook JavaScript SDK
28. Social Plugins
Facebook’s Native Component on Your Website
>
out-of-box Facebook plugins
>
no programmatic stuffs
it’s just a piece of HTML snippet
>
configure it by adjusting DOM
attributes
facebook JavaScript SDK
29. Social Plugins
Code Example
>
Insert a snippet into your HTML code
<div
class="fb-like"
data-href="https://www.facebook.com">
</div>
HTML
Result
facebook JavaScript SDK
31. Dialogs
Code Example
>
FB.ui(parameters , callback)
<a href=“https://www.facebook.com/dialog/friends/?
id=brent
&app_id=458358780877780
&redirect_uri=https://mightylowlands-6381.herokuapp.com/“>Add Brent as Friend</
a>
HTML
Add Brent as Friend
Result
facebook JavaScript SDK
33. Facebook Developer Tools
There are some tools to help out your development of Facebook app
>
Graph API Explorer
Examine the result of Graph API queries
>
JavaScript Test Console
Verify your JavaScript code’s validation and examine the result
>
Access Token Tool
For generating access tokens, for streamline your testing
facebook JavaScript SDK
38. In This Code Lab
You will learn…
>
how to integrate Facebook JavaScript SDK into your project
>
how to authenticate user’s Facebook account
>
how to access Graph API with users’ credentials
>
how to place a Facebook cool widget on your page
>
how to use Facebook dialog to save your time
facebook JavaScript SDK
39. Before We Start…
Get prepared
>
Google Moderator: http://goo.gl/OVNszf
Ask question here!
>
Code Lab Repo: https://github.com/littleq0903/fb-js-codelab
The code you will need it in the practice, check out the Wiki!
>
Download the CodeLab pack
https://github.com/littleq0903/fb-js-codelab/releases/download/v1.0/fb-js-codelab.tgz
>
Ready your editor, web browser, and passion!
facebook JavaScript SDK
40. Introduction to
facebook Python SDK
!
Tutorials & Code Lab, 2013 Winter
Colin Su
Social Network Application
facebook JavaScript SDK
42. Before We Start…
>
Code Lab Repo: https://github.com/littleq0903/fb-python-codelab
The code you will need it in the practice, check out the Wiki!
>
Turn your smartphone to the vibrating mode
facebook JavaScript SDK
45. Website v.s. Web Application
>
Website: display information to visitors
>
Web Application: interact with users, response users’ various
request
facebook JavaScript SDK
46. Web Application
>
Front End: interact with users (JavaScript)
You’ve learned.
>
Back End: deal with data (Python)
The part related to this presentation
facebook JavaScript SDK
55. Request Handler Example
Example of Bottle’s Request Handler
from bottle import Bottle
hello world
!
#create your web application
app = Bottle()
!
#define a function and point to /index
@app.route('/index')
def index():
return 'hello world'
Python
/index
facebook JavaScript SDK
56. URL Argument
Example of Bottle’s Request Handler
from bottle import Bottle
hello world
!
#create your web application
app = Bottle()
!
# <name> will be the 'name' argument in the
function
@app.route('/index/<name>')
def index(name='default'):
return "hello " + name
Python
/index/world
facebook JavaScript SDK
57. Access Request
Example of Bottle’s Request Handler
from bottle import Bottle
#import request function
from bottle import request
<LocalRequest: GET http://localhost:8080/index>
!
#create your web application
app = Bottle()
!
#define a function and point to /index
@app.route('/index')
def index():
return request
Python
/index
facebook JavaScript SDK
58. Heroku Deployment
>
First time, run heroku login to authenticate
>
Must be a Git repository: git init
>
heroku create
Create a Heroku app and add it to git remotes
>
heroku config:set var1=val1 var2=val2
Set Environment Variables on Heroku
>
git push heroku master
Deploy
facebook JavaScript SDK
59. Git Remotes
>
Git's remote branch
>
Github, Heroku or your own Git
server
>
Your Repo
git push <remote> <branch>
Github
Heroku
facebook JavaScript SDK
60. Installing Python Libraries
How to made Heroku server install Python packages for you
>
requirement.txt
Create this file and put it under the root folder
>
one package per line
>
<package name>
>
<package name>==<version>
>
(local) pip install -r ./requirements.txt
facebook JavaScript SDK
61. Facebook Python SDK
>
access Facebook Graph
>
query with FQL
>
Operating Data with Python is easier than JavaScript
facebook
x
facebook JavaScript SDK
66. Put Object
Example of Facebook Python SDK
!
Colin Su
3 seconds ago from Graph API
---------------------------
token = "..."
!
!
I'm testing api
!
import facebook
msg = "I'm testing api"
!
graph = Facebook.GraphAPI(token)
!
graph.put_object('me', 'feed', message=msg)
--------------------------Like . Comment . Promote . Share
--------------------------Obama and Mark Zurgerburg like this.
--------------------------Someone lalalalala
5 seconds ago . Like
!
Somebody ?
10 seconds ago . Like
!
!
Python
Facebook
facebook JavaScript SDK
68. FQL Query
Example of Facebook Python SDK
import facebook
!
[{u'url': u'http://www.facebook.com/littleq0903',
u'username': u'littleq0903', u'name': u'Colin Su'}]
token = "..."
!
graph = Facebook.GraphAPI(token)
!
# me() is the built-in function for returning
your id
query = "SELECT name,url,username FROM profile
WHERE id = me()"
!
print graph.fql(query)
Python
Console
facebook JavaScript SDK