On the application and development of SNS open platform with the example of Camellia women

Source: Internet
Author: User

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Editor's note: This article takes "the Camellia female" as an example, explained in simple and simple manyou open platform's application development flow. Hope to be able to "webmaster" magazine reader Friend for reference. Thank Sun Xichui, Panry, Zhang Jiaping and other friends to explain in simple and simple!

 

Developing an application to the Manyou open platform is not difficult for a developer with code authoring experience.

As long as you are familiar with the sing Ucenter home, discuz! and other community network products, familiar with BBS, SNS and other basic community characteristics and crowd characteristics, a certain amount of software development capabilities, whether PHP, Java, asp.net, Perl, ROR, etc. can be developed, Of course, developers also need to have some product experience to understand the needs of community users, have their own stable and fast independent server or virtual host, for the implementation of the application of logical processing, data storage and initial interface display. As long as you understand the above points, you can fully independently develop an application, through the Manyou open platform for tens of thousands of ucenter home sites for their own benefit and value.

Ucenter Home site is growing fast, no need to go hard to find users, as long as your application is close enough to the user, you can be like "virus" as quickly spread. To create a more user-friendly understanding of the basic steps of creating an application, let's create a "camellia woman" as an example to explain the process of developing an application.

"Camellia female" is a social life in the flower language for the prototype development. Flower language refers to people with flowers to express a certain language, feelings and desires, under certain historical conditions gradually established, for a certain range of people recognized information exchange forms. The flower language forms the core of the flower culture, in the flower exchange, the flower language is silent, but at this time the silence wins the sound, the meaning and the emotion expression is more than the speech. Flower language originated in ancient Greece, at that time is not only flowers, leaves, fruit trees have a certain meaning. In Greek mythology, the story of the creation of the Rose when Eros was born, Rose has become synonymous with love since that time. It is embarrassing to express love in public, so the flowers donated by lovers become messengers of love. With the development of the times, flowers become a social gift, more perfect flower language represents the intention of the giver. On the open platform of Manyou, "Camellia female" is a small application that conveys the flower language.

"Camellia Women" application development, need a support PHP Web server and PHP script can access the MySQL database.

Registering applications

1. Visit: http://uchome.developer.manyou.com/;

2. First registered Manyou developer account number, if you have been in Www.discuz.net, u.discuz.net and other sites registered, direct login can;

3. Click "Start"-> "Developer"-> "Create new Application";

4. Here are some steps to fill out a form when creating a new application:

I. Select "I have read and accept the Manyou development platform Agreement".

II. application Name: In this case, we fill in "Camellia female", for your own application, you have to fill out their own different names.

Iii. developer E-mail: If you have any questions or updates, manyou will contact you via this email.

Iv. Customer Service e-mail: Displayed on the introduction page of the application, users can send a message to this mailbox for help.

V.callback URL: In this case, we fill in the "http://flowers.manyou-apps.com/manyou/". You should fill in a different URL, usually you want to fill in the URL of the root directory where the application is running on your server, and note that you must end with a slash.

VI. application of the terms of service URL: Your application of the terms of service URLs.

Vii. Application Profile: Fill in your application profile.

Viii. Other settings: Follow the installation defaults.

5. Click "Submit", enter "I developed the application", here you can see the application "Camellia women" related information, including API Key, secret, etc.

Writing code

I. Planning the application of "Camellia women"

manyou/common.php

/index.php

/send.php

/receive.php

/manyou.php

Create directories and related files, note that the file encoding is UTF-8.

Second, the initialization of the application

Applications and Manyou communications are implemented through APIs that allow you to specify data on the Ucenter home Web site through MYOP open platform calls, including authentication, user information, buddy relationships, application usage, and so on.

In the case of "Camellia women" we use the Manyou official PHP class library, which enables a simple call to the Manyou API. Access wiki.developer.manyou.com/wiki/index.php/php, download the latest Manyou client library file manyou.php, and place the file in your application directory.

Add the following code to commom.php, include the Manyou client library file manyou.php, and initialize the class:

Require_once ' manyou.php ';

$manyou = new Manyou (' Your_api_key ', ' Your_secret ');

Replace "Your_api_key" and "Your_secret" with the information API KEY, SECRET, which is referred to as the "Camellia Woman" in the application I developed.

Detects if the user has added an application and will go to the Application installation page if the user does not add the application:

$manyou->require_add ();

Get current login User id:

$uid = Intval ($manyou->api_client->user_getloggedinuser ());

Get the friend ID of the currently logged-on User:

$friends = $manyou->api_client->friend_get ();

Next, configure the database and some other information, no longer repeat.

Third, use MYML to create Send Flowers page

Myml is a set of markup languages that enable applications to be tightly integrated with Ucenter home. With MYML, application developers can easily develop applications that are similar in style to Ucenter home users ' websites, increasing the comfort of user access.

For example, we want to create the "Camellia Women" page head, you can write:

Camellia Female

Four, send flowers processing

Sending flowers is mainly divided into four steps:

1. Insert data into MySQL database;

2. Send feed, realize method: Feed.publishtemplatizedaction.

The feed is an API provided to application developers by the Manyou open platform, and feeds enable you to send the latest apps to the user's buddy page.

3. Send notification, realize method: Notification.send. Notifications are also manyou APIs that send notifications or requests to a user.

4. Set the myml displayed in the user's personal homepage to achieve the method: Profile.setmyml.

Includes a list of application blocks and behaviors in the personal home page. You can pass the user ID, and if the user's ID is not specified, the currently logged user will be used. In this case, the received flowers will be displayed on the personal homepage of the recipient of the flowers.

After the application was written, visit again: http://uchome.developer.manyou.com, click "Start"-> "developer"-> "I developed the application"-> "use"-> "Install Camellia female", You will see the results of the program running.

Submit Application

Your application can only be used on MYOP open platform Ucenter home, if you want thousands of users ucenter the home Web site to use your application, please submit an audit. For auditing conditions, refer to the application auditing standards on the developer Wiki.

OK, so far a simple process has been finished, do you already have a feeling of itching? If you also need to know more about manyou open platform instructions and code-related information, please visit the Manyou Developer's Guide (http://wiki.developer.manyou.com) right away! Manyou Open platform will provide you with a new arena for free development and application.

The development of an application is so simple, move quickly!

This article source stationmaster monthly, the initial www.admin5.com reprint please explain the source.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.