Facebook API Developers Guide PHẦN 4

Facebook tóm tắt rất nhiều mã phức tạp và làm cho nhiều thủ tục thường xuyên nỗ lực gần như. Ví dụ, để thêm một liên kết đến các trang trợ giúp ứng dụng của bạn trên bảng điều khiển của bạn (điều hướng tab trên đầu trang), bạn chỉ cần thêm những dòng sau đây: | Learning Facebook Platform Fundamentals 33 pear install PhpDocumentor PEAR should install a new script that you can call from the command-line script which you then can call to create the documentation phpdoc -t path to output -d path to facebook_client_library -pp on -ti Facebook Client Documentation This line will set the output directory -t take a look at the client library path -d parse private functions within the code -pp set an HTML title of Facebook Client Documentation -ti and then output the results in HTML using frames. There are many more options for producing documentation but these options will produce very useful documentation while you develop your Facebook application. For more information about using this tool check out the phpDocumentor web site at http . API Primer Facebook has some rather convenient out-of-the box tools for interacting with its back end. At the core of the platform is a set of API calls that wrap more complex code into a single call. In fact most of the API calls are simply wrappers for complex FQL calls. So without further adieu let s take a look at what you have available to you through the API calls. Facebook s API methods are broken into logical groups of calls. These API calls are also where your first interaction with the platform comes into play. You don t need to use the client library it just makes things faster since you would need to write these in your language in order to interact with the platform. To set up the client library for PHP you simply include the client library in your code. For example the following snippet makes sure users are logged on to Facebook before displaying a list of the user s friends. Figure 3-1 shows the results. php Set the configuration settings for Facebook facebook_config debug false facebook_config api_key your_api_key facebook_config secret_key your_secret_key include the Facebook client library require_once path_to_client_library Graham 34 Learning .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
3    76    2    03-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.