Kraken Social Web

Programming 2014. 5. 23. 22:37

Kraken social web is made for gathering data of Social Media such as Facebook, Twitter and Linked-in. The first version of its API supports Facebook Graph API.Other functions and platforms will be developed later. First, in Facebook, every API returns JSON Object consisted offluctuating data field according to permissions. You can earn Social Web Data by using the following simple functions and rule.

If you want to get information about youself, you can use function like this: getSpecificInfo(“YOUR_ID” or “me”) or getBasicInfo(“YOUR_ID” or “me”) -(“me” is a constant in Facebook).These functions have differences in return form only. First one returns JSON Array form and the other one returns single JSON Object form. Its difference is based on fluctuating count of data in Facebook by one Graph API query. This means if data exceed quantity to be able to show in one page, Facebook will send paged information.

All objects in Facebook have connections. For example, one user has a one’s own connection by user’s id. And user’s id has connections such as post, feed, like, album and so on.So you can get information through getSpecificInfo(“YOUR_ID” or “me” , “CONNECTION”) or getBasicInfo(“YOUR_ID” or “me” , “CONNECTION”). Like the above example,, all objects have connections, so you can use like getSpecificInfo(“OBJECT ID” , “CONNECTION”) and  getBasicInfo(“OBJECT ID” or “me” , “CONNECTION”).

follow a few steps to use this Library.

1. get your or user’s Access Token to access Facebook Graph API. if you want temporary Access token, visit “https://developers.facebook.com/tools/explorer?method=GET&path=100002488995162%3Ffields%3Did%2Cname”. and then you can earn your Access Token. or if you want permission not temporary, use the Oauth though Facebook App.

2. Now, you already get the Access Token of Facebook, use like this: Facebook graph = new Facebook(YOUR_ACCESS_TOKEN, CALL_BACK_URL{it can be null or not}).

3. Then, you can access information through this object by using functions like this: graph.getBasicInfo or graph.getSpecificInfo. and you can get the JSON Object including user’s information.

here are some examples.

  • graph.getBasicInfo(“me”);
  • graph.getBasicInfo(“me”,”friends”);
  • graph.getBasicInfo(“me”,”home”);
  • graph.getBasicInfo(“me”,”feed”);
  • graph.getBasicInfo(“me”,”likes”);
  • graph.getBasicInfo(“me”,”movies”);
  • graph.getBasicInfo(“me”,”music”);
  • graph.getBasicInfo(“me”,”books”);
  • graph.getBasicInfo(“me”,”notes”);
  • graph.getBasicInfo(“me”,”permissions”);
  • graph.getBasicInfo(“me”,”photos”);
  • graph.getBasicInfo(“me”,”album”);
  • graph.getBasicInfo(“me”,”videos”);
  • graph.getBasicInfo(“me”,”video/uploaded”);
  • graph.getBasicInfo(“me”,”events”);
  • graph.getBasicInfo(“me”,”groups”);
  • graph.getBasicInfo(“me”,”checkins”);
  • graph.getBasicInfo(“me”,”locations”);
  • and you can use graph.getSpecificInfo in same way
  • also you can use like this: User user = new User(); user.parseJson(graph.getBasicInfo(“me”)); every object has appropriate pair object to parse


'Programming' 카테고리의 다른 글

Funf FrameWork  (0) 2014.05.23
Funf Tutorial: Wifi Scanner Structure  (0) 2014.05.23
Funf Project  (0) 2014.05.23
Posted by MeatNBrew
l

Funf Project

Programming 2014. 5. 23. 22:36

Funf is an open source project for gathering data from android platform. There is a system overview for developers. if you can’t see details, click the following image. This is just an overview. Tutorial and Class details will be shown next as

UML like in this picture.

'Programming' 카테고리의 다른 글

Funf FrameWork  (0) 2014.05.23
Funf Tutorial: Wifi Scanner Structure  (0) 2014.05.23
Kraken Social Web  (0) 2014.05.23
Posted by MeatNBrew
l

usb initialization is starting in vl.c, line 4259. as below.

if (usb_enabled(false)) {
if (foreach_device_config(DEV_USB, usb_parse) < 0)
exit(1);
}

static int usb_parse(const char *cmdline)
{
int r;
r = usb_device_add(cmdline);
if (r < 0) {
fprintf(stderr, "qemu: could not add USB device '%s'\n", cmdline);
}
return r;
}

static int usb_device_add(const char *devname)
{
USBDevice *dev = NULL;
#ifndef CONFIG_LINUX
const char *p;
#endif

if (!usb_enabled(false)) {
return -1;
}

/* drivers with .usbdevice_name entry in USBDeviceInfo */
dev = usbdevice_create(devname);
if (dev)
goto done;

/* the other ones */
#ifndef CONFIG_LINUX
/* only the linux version is qdev-ified, usb-bsd still needs this */
if (strstart(devname, "host:", &p)) {
dev = usb_host_device_open(usb_bus_find(-1), p);
}
#endif
if (!dev)
return -1;

done:
return 0;
}

USBDevice *usbdevice_create(const char *cmdline)
{
USBBus *bus = usb_bus_find(-1 /* any */);
LegacyUSBFactory *f = NULL;
GSList *i;
char driver[32];
const char *params;
int len;

params = strchr(cmdline,':');
if (params) {
params++;
len = params - cmdline;
if (len > sizeof(driver))
len = sizeof(driver);
pstrcpy(driver, len, cmdline);
} else {
params = "";
pstrcpy(driver, sizeof(driver), cmdline);
}

for (i = legacy_usb_factory; i; i = i->next) {
f = i->data;
if (strcmp(f->usbdevice_name, driver) == 0) {
break;
}
}
if (i == NULL) {
#if 0
/* no error because some drivers are not converted (yet) */
error_report("usbdevice %s not found", driver);
#endif
return NULL;
}

if (!bus) {
error_report("Error: no usb bus to attach usbdevice %s, "
"please try -machine usb=on and check that "
"the machine model supports USB", driver);
return NULL;
}

if (!f->usbdevice_init) {
if (*params) {
error_report("usbdevice %s accepts no params", driver);
return NULL;
}
return usb_create_simple(bus, f->name);
}
return f->usbdevice_init(bus, params);
}

if it uses classic device, usb_create_simple will be called for usb_device_type_info.

And,  if it doesn't, we should find what is assinged to usbdevice_init function pointer.

classic initialization for USB is as below.

static void usb_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
k->bus_type = TYPE_USB_BUS;
k->init = usb_qdev_init;
k->unplug = qdev_simple_unplug_cb;
k->exit = usb_qdev_exit;
k->props = usb_props;
}

static const TypeInfo usb_device_type_info = {
.name = TYPE_USB_DEVICE,
.parent = TYPE_DEVICE,
.instance_size = sizeof(USBDevice),
.abstract = true,
.class_size = sizeof(USBDeviceClass),
.class_init = usb_device_class_init,
};

and here are a function initialization for USB. every usb function uses this usb_legacy_register function to initialize.

void usb_legacy_register(const char *typename, const char *usbdevice_name,
USBDevice *(*usbdevice_init)(USBBus *bus,
const char *params))
{
if (usbdevice_name) {
LegacyUSBFactory *f = g_malloc0(sizeof(*f));
f->name = typename;
f->usbdevice_name = usbdevice_name;
f->usbdevice_init = usbdevice_init;
legacy_usb_factory = g_slist_append(legacy_usb_factory, f);
}
}

but, usbdevice_init function is also a function pointer. so i listed up functions using usb_legacy_register function.

ccid_register_type, usb_audio_register_type, usb_bt_register_type, usb_hid_register_type, usb_msd_register_type, usb_host_register_type, usb_net_register_type, usb_serial_register_type, usb_wacom_register_type.

 

The list up above, those are USBDeviceClass, not DeviceClass.  both have init function, so the function DeviceClass has will be called, and then, the functions USBDeviceClass will be called by DeviceClass's init function.

 

and finally, all those functions are going to call qdev_init_nofail function.

as we know, this function call  object_property_set_bool(OBJECT(dev), true, "realized", &local_err); for initializing device.

then, props->set is going to be called and props and a init function is assign in classes for USB. 

DeviceState calls device_set_realized, and DeviceClass calls deivce_realize. and then, DeviceClass calls init function.

Posted by MeatNBrew
l