0

how to identify the users who is installed application

HI

have a problem.

how to identify the users who is installed application.
how to send notice and email.

thinks

by
2 Replies
  • QUOTE (Jarph @ Nov 6 2009, 05:12 AM) <{POST_SNAPBACK}>
    HI

    have a problem.

    how to identify the users who is installed application.
    how to send notice and email.

    thinks


    Can you elaborate a bit? You are the developer of an application and want to contact all users who use the app?
    0
  • QUOTE (Dustin Whittle @ Nov 6 2009, 12:22 PM) <{POST_SNAPBACK}>
    Can you elaborate a bit? You are the developer of an application and want to contact all users who use the app?


    Thanks for your reply.

    I have three questions the following:

    1. I want to see a user's friends to use the application to install the application.

    2. Also, how to use the API to send a notification, invite your friends, send e-mail.

    3.
    Shared Yahoo! ApplicationsThe following Open Data Table provides a list of Yahoo! Applications that you and your friends have installed, indicating whether each app is installed exclusively by you, your friends, or both.

    This table showcases the following:

    .complex E4X usage, including namespaces, filtering, searching, and creation
    .authenticated calls to Yahoo! Social APIs using y.query
    .setting a security level to user to force authenticated calls only
    .optional variable that changes the function (searches on a specific friend)
    .handling page parameters


    <?xml version="1.0" encoding="UTF-8" ?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="user">
    <meta>
    <sampleQuery> select * from {table}</sampleQuery>
    </meta>
    <bindings>
    <select itemPath="root.install.app" produces="XML">
    <urls>
    <url></url>
    </urls>
    <inputs>
    <key id='friendguid' type='xs:string' paramType='variable' />
    </inputs>
    <execute><![CDATA[
    function createInstallElement(update,type) {
    var bits = update.itemurl.toString().split("/");
    var appid = bits[bits.length-2].substring(1);//get the appid from the install url
    var title = update.title.toString();
    default xml namespace = '';
    var el = <app who={type} id={appid}>{title}</app>;
    default xml namespace = 'http:://social.yahooapis.com/v1/updates/schema.rng';
    return el;
    }

    default xml namespace = '';
    var root = <install/>;

    //get my friends installs from updates
    var friendapp_installs = null;
    if (friendguid) {
    //only do deltas to this friend
    friendapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid=@guid and type="appInstall" | unique(field="itemtxt")',{guid:friendguid});
    } else {
    //all friends
    friendapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid in (select guid from social.connections(0) where owner_guid=me) and type="appInstall" | unique(field="itemtxt")');
    }
    //get my installs from updates
    var myapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid=me and type="appInstall" | unique(field="itemtxt")');
    //we're going to keep a collection for each variant of the diff between my installs and my friend(s)
    var myapp_installs = myapp_installs.results;
    var friendapp_installs = friendapp_installs.results;
    default xml namespace = 'http:://social.yahooapis.com/v1/updates/schema.rng';
    for each (var myupdate in myapp_installs.update) {
    y.log("myupdate "+myupdate.localName());
    //use e4x to search for matching node in friendapp with the same itemtxt (appid)
    var matching = friendapp_installs.update.(itemtxt==myupdate.itemtxt.toString());
    if (matching.length()>0) {
    //found, we both have it
    root.install+=createInstallElement(myupdate,"shared");
    //y.log("Found "+myupdate.title+" in both");
    myupdate.@matched = true;
    matching.@matched = true;
    } else {
    //not in my friends apps, so add it to me only list
    //y.log("Found "+myupdate.title+" in mine only");
    root.install+=createInstallElement(myupdate,"me");
    myupdate.@matched = true;
    }
    }
    //anything left in the friends app list that doesnt have a "match" attribute is not installed by me
    for each (var friendupdate in friendapp_installs.update.(@matched!=true)) {
    //y.log("Found "+friendupdate.title+" in my friends only");
    root.install+=createInstallElement(friendupdate,"friend");
    }
    //return the three sets of results
    default xml namespace = '';
    response.object = <root>{root}</root>;
    ]]></execute>
    </select>
    </bindings>
    </table>
    <?xml version="1.0" encoding="UTF-8" ?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="user">
    <meta>
    <sampleQuery> select * from {table}</sampleQuery>
    </meta>
    <bindings>
    <select itemPath="root.install.app" produces="XML">
    <urls>
    <url></url>
    </urls>
    <inputs>
    <key id='friendguid' type='xs:string' paramType='variable' />
    </inputs>
    <execute><![CDATA[
    function createInstallElement(update,type) {
    var bits = update.itemurl.toString().split("/");
    var appid = bits[bits.length-2].substring(1);//get the appid from the install url
    var title = update.title.toString();
    default xml namespace = '';
    var el = <app who={type} id={appid}>{title}</app>;
    default xml namespace = 'http:://social.yahooapis.com/v1/updates/schema.rng';
    return el;
    }

    default xml namespace = '';
    var root = <install/>;

    //get my friends installs from updates
    var friendapp_installs = null;
    if (friendguid) {
    //only do deltas to this friend
    friendapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid=@guid and type="appInstall" | unique(field="itemtxt")',{guid:friendguid});
    } else {
    //all friends
    friendapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid in (select guid from social.connections(0) where owner_guid=me) and type="appInstall" | unique(field="itemtxt")');
    }
    //get my installs from updates
    var myapp_installs = y.query('select title, itemtxt, itemurl from social.updates(1000) where guid=me and type="appInstall" | unique(field="itemtxt")');
    //we're going to keep a collection for each variant of the diff between my installs and my friend(s)
    var myapp_installs = myapp_installs.results;
    var friendapp_installs = friendapp_installs.results;
    default xml namespace = 'http:://social.yahooapis.com/v1/updates/schema.rng';
    for each (var myupdate in myapp_installs.update) {
    y.log("myupdate "+myupdate.localName());
    //use e4x to search for matching node in friendapp with the same itemtxt (appid)
    var matching = friendapp_installs.update.(itemtxt==myupdate.itemtxt.toString());
    if (matching.length()>0) {
    //found, we both have it
    root.install+=createInstallElement(myupdate,"shared");
    //y.log("Found "+myupdate.title+" in both");
    myupdate.@matched = true;
    matching.@matched = true;
    } else {
    //not in my friends apps, so add it to me only list
    //y.log("Found "+myupdate.title+" in mine only");
    root.install+=createInstallElement(myupdate,"me");
    myupdate.@matched = true;
    }
    }
    //anything left in the friends app list that doesnt have a "match" attribute is not installed by me
    for each (var friendupdate in friendapp_installs.update.(@matched!=true)) {
    //y.log("Found "+friendupdate.title+" in my friends only");
    root.install+=createInstallElement(friendupdate,"friend");
    }
    //return the three sets of results
    default xml namespace = '';
    response.object = <root>{root}</root>;
    ]]></execute>
    </select>
    </bindings>
    </table>

    Run this example in the YQL console.

    How to run this example?

    Thanks !
    0
  • Hi Duo,

    Let me see if I can address some of these items with some of our documentation links:

    1. This sample code tutorial can provide you information on how to get the friends (connections) of a particular user: https://developer.yahoo.com/yap/guide/other....html#my_social

    2. Our notification / invite systems work through our YML (http://developer.yahoo.com/yap/guide/yapdev-yml.html) tags. These notifications need to be user initiated events on the system (will not be done automatically). The yml:friend-selector tag will allow you to select a series of friends from a list (http://developer.yahoo.com/yap/guide/friend-selector.html), the yml:message tag will allow you to send form information through to a user's e-mail (http://developer.yahoo.com/yap/guide/message.html) and yml:share will allow you to send application share e-mails to people (http://developer.yahoo.com/yap/guide/share.html)

    3. That sample looks to be an example of a YQL open data table. Here is the documentation on how to use and run one of those: http://developer.yahoo.com/yql/guide/yql-o...es-chapter.html

    Jonathan LeBlanc
    Technology Evangelist
    Yahoo! Developer Network
    Twitter: jcleblanc
    0

Recent Posts

in YAP