Robot network system utilize several modules that provide a URL transfer, supporting HTTP, HTTPS, IMAP, POP3 and SMTP. All these modules were extended by urbiscript functions that provide ready to use web browser and mailing system. With this part of structure you will be able to use your Google account, Facebook profile, mailbox and much more. Network part part of structure use following modules UMail (POCO) or UMail (cURL), UBrowser, UGCalendar (with Google Contacts), UFacebook and UTextTool.

Web browser

Web browser (RSS reader) is a kind of application that it use based mainly on graphical interface. Despite of you can still gets some information from web code source. For this purpose lot of browsing functions were implemented in the UBrowser module. A full copu of this module was integrated to the network part of structure. Please read UBrowser documentation for more detailed descriptions.

   // go to the given address, returns false if any problem occurs inside module (check console information)
robot.network.browser.Go( "address" ); 
   // set on/off redirection, default if true
robot.network.browser.redirectionEnable;
   // returns a request status code, ex. 
   // 200 - OK (1xx Informational, 2xx Success, 3xx Redirection, 
   // 4xx Client Error, 5xx Server Error, more here)
robot.network.browser.status; 
   // returns a request status reason ex. (status = 404, reason = "Not Found")
robot.network.browser.reason; 
   // get a finall address (after namy redirection), it is usefull to avoid redirection in the future
robot.network.browser.address;
   // cookie functions
   // set permission to read cookies, default is false
robot.network.browser.cookiesEnable = bool; 
   // get the number of cookies and feed your robot if he is hungry :)
robot.network.browser.cookies 
   // get cookie details as string collection
   // (name, comment, domain, path, max-age, httponly, version, secure, and value)
robot.network.browser.GetCookie( ID );
   // content functions
   // get a raw server response (after tidy process and encoding)
robot.network.browser.rawContent; 
   // get a formatted content (rawContent) as a form:
   // node_number | node_type | indents node_name:text
   // or
   // attribute_number | node_type | indents attribute_name:attribute_value
robot.network.browser.content; 
   // save content to the file
   // type=0 save raw content
   // type=1 save cleaned content
   // type=2 save formatted content
robot.network.browser.SaveContent("file_name" , type);
   // node walking and searching functions
   // get text of the node given path, see ex. 2 in the UBrowser documentation
robot.network.browser.GetTextByPath( "XPath" ); 
   // get child nodes given path, see ex. 3 in the UBrowser documentation
robot.network.browser.GetNodesByPath("XPath"); 
   // get list of attributes and values given node path 
robot.network.browser.GetAtributesByPath("XPath"); 
   // get list of elements (node name, list of attributes and text), see ex. 5 in the UBrowser documentation
robot.network.browser.GetElementsByPath("XPath"); 
   // get a list of positions given pattern, see ex. 6 in the UBrowser documentation
robot.network.browser.FindPosition("node_name" , [ "attribute1" , "attribute=/"value/""],... ] ); 
   // get a text or attribute value given position, see ex. 7 in the UBrowser documentation
robot.network.browser.GetByPosition(node_number, atribute_number);

Email client

According to your needs you can use two kinds of mailing modules. UMail (POCO) utilize POCO library and provides SMTP/POP3 mailbox handling, UMail (cURL) based on cURL library provides SMTP/IMAP mailbox handling. UTextTool must be also enabled. Set the proper options in the robot configuration. For now the network part of robot structure contain two mailbox configurations, for user and for robot use. It can be easy extended with more mailboxes. Remember about password file place configuration.

Sending functions

   // set a sender name
robot.network.mail["user"|"robot"].send.From("I Robot"); 
   // set a recipent list
robot.network.mail["user"|"robot"].send.To(["address1","address2",...]); 
   // set a carbon copy recipent list
robot.network.mail["user"|"robot"].send.Cc(["address3","address4",...]); 
   // set a blind carbon copy recipent list
robot.network.mail["user"|"robot"].send.Bcc(["address5","address6",...]); 
   // set a subject
robot.network.mail["user"|"robot"].send.Subject("text"); 
   // set a content (you can use html tags, even links to attachments)
robot.network.mail["user"|"robot"].send.Content("text"); 
   // add attachments (set a path and name of attached file)
robot.network.mail["user"|"robot"].send.Attachment(["file1","file2",...]); 
   // available only with UMail (cURL)// set attachments IDs 
   // (see example 2 in the UMail (cURL) documentation)
robot.network.mail["user"|"robot"].send.AttachmentID(["file1_ID","file2_ID",...]); 
   // load html content data from mailTemplates folder
robot.network.mail["user"|"robot"].LoadContent("path/to/file.html");
   // perform a sending process, return false if any problem occurs inside module 
robot.network.mail["user"|"robot"].Send();

Receiving functions

   // perform check new (unread) emails, return false if any problem occurs inside module
robot.network.mail["user"|"robot"].Check();
 
   // functions available only with UMail (POCO)
   // a number of new emails in the user's INBOX folder 
robot.network.mail["user"|"robot"].receive.newNo;
   // perform download all new emails, return false if any problem occurs inside module
robot.network.mail["user"|"robot"].Receive();  
   // save all attachements of received new emails, return false if any problem occurs inside module
robot.network.mail["user"|"robot"].receive.SaveAttachments("path/to/save/");
 
   // functions available only with UMail (cURL)
   // a list of numbers of new emails in the user's INBOX folder
robot.network.mail["user"|"robot"].receive.ID; 
   // perform download email process of given ID, return false if any problem occurs inside module
robot.network.mail["user"|"robot"].Receive("IDx"); 
   // save attachemnts of given ID received email, return false if any problem occurs inside module 
robot.network.mail["user"|"robot"].receive.SaveAttachments(ID,"path/to/save/");
   // these fields in case of UMail (POCO) contains vectors of all new emails data 
   // in case of UMail (cURL) only data from one (downloaded) email
   // get sender name(s)
robot.network.mail["user"|"robot"].receive.From; 
   // get a main recipient list(s)
robot.network.mail["user"|"robot"].receive.To; 
   // get a carbon copy recipient list(s)
robot.network.mail["user"|"robot"].receive.Cc; 
   // get a subject(s)
robot.network.mail["user"|"robot"].receive.Subject; 
   // get a date of emial(s)
robot.network.mail["user"|"robot"].receive.Date; 
   // get a plain text content of emial(s)
robot.network.mail["user"|"robot"].receive.Content; 
   // get a HTML content data of email

Weather forecast

This part of robot network structure utilize UBrowser module and it gets weather forecast from YAHOO weather provider. All needed configuration like your location you can find in the robot configuration. 

   // Get weather forecast
robot.network.weather.Get();
 
   // get info about weather location
robot.network.weather.location.city;
robot.network.weather.location.region;
robot.network.weather.location.country;
 
   // get info about  units
robot.network.weather.units.temperature;
robot.network.weather.units.distance;
robot.network.weather.units.pressure;
robot.network.weather.units.speed;
 
   // get info about wind 
robot.network.weather.wind.chill;
robot.network.weather.wind.direction;
robot.network.weather.wind.speed;
 
   // get info about atmosphere
robot.network.weather.atmosphere.humidity;
robot.network.weather.atmosphere.visibility;
robot.network.weather.atmosphere.pressure;
robot.network.weather.atmosphere.rising;
 
   // get info about sunrise and sunset
robot.network.weather.astronomy.sunrise;
robot.network.weather.astronomy.sunset;
 
   // get info about weather condition
robot.network.weather.condition.text;
robot.network.weather.condition.code;
robot.network.weather.condition.temperature;
 
   // get 5 day weather forecast
robot.network.weather.forecast.day1;
robot.network.weather.forecast.day2;
robot.network.weather.forecast.day3;
robot.network.weather.forecast.day4;
robot.network.weather.forecast.day5;

News reader (RSS reader)

This part of robot network structure utilize UBrowser and UTextTool module and it gets news from different rss channels. 

Examples:
http://feeds.bbci.co.uk/news/world/europe/rss.xml
http://www.skynews.com.au/rss/
http://www.theaustralian.com.au/help/rss
http://www.abc.net.au/news/feeds/rss/
http://feeds.feedburner.com/cnet/NnTv?format=xml
http://www.cnet.com/rss

   // get news from given rss address
robot.network.news.Get("address");
   // number of news 
robot.network.news.count;
   // news published date
robot.network.news.date;
   // title of newst
robot.network.news.title;
   // full description
robot.network.news.description;
   // category (optional)
robot.network.news.category;

Facebook

This part of network structure can be use for Facebook social networking service. It is based on UFacebook module and for now has two instances to handle user's FB profile and robot's one. Facebook structure use UTextTool also, so you must enable it in the robot configuration. Using this structure your robot will be able to to post new stories, upload photos (eg. from his camera), retrieve posts and  a variety of other tasks that your FB app might need to do. Use our official "FLASH Connect" facebook application. Read UFacebook module docu for more info.

First, connect "FLASH Connect" app with your FB account. Click FB login button below
 
 
 
   // download some content from web (ex. photo)
robot.network.facebook["user"|"robot"].DownloadContent("link", "path");
   // get user/robot info 
robot.network.facebook["user"|"robot"].user.Get();
   // the id of user account
robot.network.facebook["user"|"robot"].user.ID;
   // the user full name
robot.network.facebook["user"|"robot"].user.name;
   // the user first name
robot.network.facebook["user"|"robot"].user.firstName;
   // the user last name
robot.network.facebook["user"|"robot"].user.lastName;
   // gender pronoun selected by this person
robot.network.facebook["user"|"robot"].user.gender;
   // the user birthday in the format MM/DD/YYYY
robot.network.facebook["user"|"robot"].user.birthday;
   // the user current location as entered by them on their profile 
robot.network.facebook["user"|"robot"].user.location;
   // the user primary email address listed on their profile
robot.network.facebook["user"|"robot"].user.email;
   // get user's likes
robot.network.facebook["user"|"robot"].user.GetLikes();
   // the like ID
robot.network.facebook["user"|"robot"].user.likeID;
   // the like Name
robot.network.facebook["user"|"robot"].user.likeName;
   // the like category
robot.network.facebook["user"|"robot"].user.likeCategory;
   // get posts, feed, home
   // posts - get posts created by the user (on her own wall or the wall of a friend), and it may include any kind of content such as shared links, check-ins, photos and status updates,
   // feed - all the things that a user might see on his own wall, shared links, check-ins, photos and status updates. This also includes posts made by friends on the user's wall,
  // home- all the posts created by you and your friends, i.e. what you usually find on the “News Feed” of Facebook,
robot.network.facebook["user"|"robot"].post.GetPosts();
robot.network.facebook["user"|"robot"].post.GetFeed();
robot.network.facebook["user"|"robot"].post.GetHome();
   // post message on the wall
robot.network.facebook["user"|"robot"].post.PutPost("message");
   // post id number
robot.network.facebook["user"|"robot"].post.ID;
   // the user ID who posted the post
robot.network.facebook["user"|"robot"].post.fromID;
   // the user full name who posted the post
robot.network.facebook["user"|"robot"].post.fromName;
   // the post message content
robot.network.facebook["user"|"robot"].post.message;
   // indicating the object type of this post (link, status, photo, video)
robot.network.facebook["user"|"robot"].post.type;
   // description of the type of a status update (mobile_status_update, 
   // created_note, added_photos, added_video, shared_story, created_group, 
   // created_event, wall_post, app_created_story, published_story, 
   // tagged_in_photo, approved_friend)
robot.network.facebook["user"|"robot"].post.statusType;
   // text from stories not intentionally generated by users, such as those 
   // generated when two people become friends, or when someone else posts 
   // on the person's wall
robot.network.facebook["user"|"robot"].post.story;
   // the ID of any uploaded photo or video attached to the post
robot.network.facebook["user"|"robot"].post.objectID;
   // a description of a link in the post
robot.network.facebook["user"|"robot"].post.description;
   // a caption of a link/photo in the post
robot.network.facebook["user"|"robot"].post.caption;
   // the time of the last change to this post, or the comments on it
robot.network.facebook["user"|"robot"].post.updatedTime;
   // returns only status updates posted by the user on his own wall
robot.network.facebook["user"|"robot"].status.Get();
   // the status message ID
robot.network.facebook["user"|"robot"].status.ID;
   // the user ID who posted the message
robot.network.facebook["user"|"robot"].status.fromID;
   // the user full name who posted the message
robot.network.facebook["user"|"robot"].status.fromName;
// the status message content
robot.network.facebook["user"|"robot"].status.message;
// the time the message was published
robot.network.facebook["user"|"robot"].status.updatedTime;
    // get all user albums 
robot.network.facebook["user"|"robot"].album.Get();
   // the album ID
robot.network.facebook["user"|"robot"].album.ID;
   // the title of the album
robot.network.facebook["user"|"robot"].album.name;
   // number of photos in this album
robot.network.facebook["user"|"robot"].album.count;
   // the type of the album (app, cover, profile, mobile, wall, normal, album)
robot.network.facebook["user"|"robot"].album.type;
   // whether the viewer can upload photos to this album
robot.network.facebook["user"|"robot"].album.canUpload;
   // get all photos in the album 
robot.network.facebook["user"|"robot"].photo.Get(album_id); 
   // send a photo to the album
   // name - brief description of the photo
   // source - path or url of the photo 
robot.network.facebook["user"|"robot"].photo.Put("album_id", "name", "/path/to/photo/photo.jpg");
   // send a photo on the wall,
   // message - message on the wall
   // photo - path or url of the photo
robot.network.facebook["user"|"robot"].photo.PostOnTimeline("message","/path/to/photo/photo.jpg");
   // the photo ID 
robot.network.facebook["user"|"robot"].photo.ID;
   // the user provided caption given to this photo
robot.network.facebook["user"|"robot"].photo.name;
   // link to the image source of the photo
robot.network.facebook["user"|"robot"].photo.source;
   // the last time the photo or its caption was updated
robot.network.facebook["user"|"robot"].photo.updatedTime;
   // get unread facebook notifications
robot.network.facebook["user"|"robot"].notification.Get(); 
   // clear all pending notifications 
robot.network.facebook["user"|"robot"].notification.Clear();
   // the notification's id
robot.network.facebook["user"|"robot"].notification.ID;
   // the id (user, page, app, etc.) that 'sent', or is the 
   // source of the notification
robot.network.facebook["user"|"robot"].notification.fromID;
   // the full name (user, page, app, etc.) that 'sent', or is the 
   // source of the notification,
robot.network.facebook["user"|"robot"].notification.fromName;
   // the message text in the notification
robot.network.facebook["user"|"robot"].notification.message;
   // the message title text in the notification
robot.network.facebook["user"|"robot"].notification.title;
   // the notification type
robot.network.facebook["user"|"robot"].notification.type;
   // the object (this can be a post, a photo, a comment, etc.) 
   // that was the subject of the notification
robot.network.facebook["user"|"robot"].notification.objectID;
   // when the notification was last updated
robot.network.facebook["user"|"robot"].notification.updatedTime;
   // get all unread or unseen messages, mode:
robot.network.facebook["user"|"robot"].message.GetUnread(); 
robot.network.facebook["user"|"robot"].message.GetUnseen();
   // the ID of a conversation, in a format similar to t_id.000000000000000
robot.network.facebook["user"|"robot"].message.conversationID;
   // the user ID who send the message
robot.network.facebook["user"|"robot"].message.fromID;
   // the user ID who send the message
robot.network.facebook["user"|"robot"].message.fromName;
   // the text of reply
robot.network.facebook["user"|"robot"].message.message;
   // when the notification was created
robot.network.facebook["user"|"robot"].message.createdTime;
   // get all groups 
robot.network.facebook["user"|"robot"].group.Get();
   // the group ID
robot.network.facebook["user"|"robot"].group.ID
   // the name of the group
robot.network.facebook["user"|"robot"].group.name;
   // Since April 30th, 2014 (FB API 2.0) friends list no longer 
   // includes the full list of a person's friends. Instead, it 
   // now returns the list of that person's friends who are also
   // using your app. 
   //
   // field friends is reserved by urbi syntax
   //
   // get users friends using your app
robot.network.facebook["user"|"robot"].fri_end.Get();
   // the friend ID
robot.network.facebook["user"|"robot"].fri_end.ID;
   // the name of the friend
robot.network.facebook["user"|"robot"].fri_end.name;
   // get users events 
robot.network.facebook["user"|"robot"].event.Get();
   // the event ID
robot.network.facebook["user"|"robot"].event.ID;
   // the name of the event
robot.network.facebook["user"|"robot"].event.name;
   // the location of the event, if any
robot.network.facebook["user"|"robot"].event.location;
   // start time of the event
robot.network.facebook["user"|"robot"].event.startTime;
   // end time of the event
robot.network.facebook["user"|"robot"].event.endTime;
   // long-form description of the event
robot.network.facebook["user"|"robot"].event.description;
   // get list of users likes
robot.network.facebook["user"|"robot"].like.Get("object_id"); 
   // like something 
robot.network.facebook["user"|"robot"].like.Put("object_id");
   // the like from ID 
robot.network.facebook["user"|"robot"].like.fromID;
   // the like from Name
robot.network.facebook["user"|"robot"].like.fromName;
   // get comments of something
robot.network.facebook["user"|"robot"].comment.Get();
   // comment something
robot.network.facebook["user"|"robot"].comment.Put("object_id", "message"); 
   // get comments from notification
robot.network.facebook["user"|"robot"].comment.GetFromNotifications();
   // the user ID who put the comment
robot.network.facebook["user"|"robot"].comment.fromID;
   // the user name who put the comment
robot.network.facebook["user"|"robot"].comment.fromName;
   // comment text (content)
robot.network.facebook["user"|"robot"].comment.message;

Google Calendar

This part of network structure can be use to handle your Google account (for now Google Calendar and Google Contacts only). It is based on UGCalendar (+Contacts)Calendar (+Contacts) module and for now has two instances to handle user's Account profile and robot's one. Network structurte use UTextTool also, so it must be enabled in the robot configuration. Using this structure your robot will be able to check your personal calendar and get informations about youe everyday events. Getting contacts to your friends robot can send them emials everytime you ask him. Use our official "FLASH Connect" Google application. Read UGCalendar (+Contacts)Calendar (+Contacts) module docu for more info.

// get list of calendars info
robot.network.gcalendar["user"|"robot"].calendar.Get();
// identifiers of the calendars
robot.network.gcalendar["user"|"robot"].calendar.ID;
// titles of the calendars
robot.network.gcalendar["user"|"robot"].calendar.summary;
// descriptions of the calendars
robot.network.gcalendar["user"|"robot"].calendar.description;
// geographic locations of the calendars as free-form text
robot.network.gcalendar["user"|"robot"].calendar.location;
// the time zones of the calendars
robot.network.gcalendar["user"|"robot"].calendar.timeZone;
   // get list of calendar events 
   // "calendar_ID" - identifiers of the calendar,
   // "from date" - optional start time in format "YYYY-MM-YY HH:MM:SS" or "YYYY-MM-YY"
   // "to date" - optional end time in format "YYYY-MM-YY HH:MM:SS" or "YYYY-MM-YY"
robot.network.gcalendar["user"|"robot"].event.Get("calendar_ID","from_date","to_date");
   // get list of calendar events by calendar name
robot.network.gcalendar["user"|"robot"].event.GetFromCalendarName("calendar_name","start_time","end_time");
   // get list of calendar events starting from today
robot.network.gcalendar["user"|"robot"].event.GetFromToday("calendar_name");
   // get list of calendar events starting from now
robot.network.gcalendar["user"|"robot"].event.GetFromNow("calendar_name");
   // get list of calendar events for today only
robot.network.gcalendar["user"|"robot"].event.GetForToday("calendar_name");
   // get list of calendar events for today only, starting from now
robot.network.gcalendar["user"|"robot"].event.GetForTodayFromNow("calendar_name");
   // set one evnt in the given calendar,
   // "calendar_ID" - identifiers of the calendar,
   // "summary" - title of the event,
   // "location" - location of the event
   // "start time" - start time of the event in format "YYYY-MM-YY HH:MM:SS" or "YYYY-MM-YY"
   // "end time" - end time of the event in format "YYYY-MM-YY HH:MM:SS" or "YYYY-MM-YY"
   // email - number of minutes before the start of the event when the reminder should send 
   // via email (-1 - no email reminder),
   // popup - number of minutes before the start of the event when the reminder should send 
   // via popup UI (-1 - no popup reminder),
   // sms - number of minutes before the start of the event when the reminder should send 
   // via sms (-1 - no sms reminder)
robot.network.gcalendar["user"|"robot"].event.Set("calendar_ID", "summary", "location", "start_time", "end_time","email", "popup", "sms");
   // identifiers of the events 
robot.network.gcalendar["user"|"robot"].event.ID;
   // titles of the events
robot.network.gcalendar["user"|"robot"].event.summary;
   // descriptions of the events
robot.network.gcalendar["user"|"robot"].event.description;
   // geographic locations of the eventss as free-form text
robot.network.gcalendar["user"|"robot"].event.location;
   // the (inclusive) start time of the events
robot.network.gcalendar["user"|"robot"].event.startTime;
   // the (exclusive) end time of the events
robot.network.gcalendar["user"|"robot"].event.endTime;

Google Contacts

See description to Google Calendar.
   // get list of contact group info 
robot.network.gcontact["user"].group.Get();
   // identifiers of the contact group
robot.network.gcontact["user"].group.ID;
   // titles of the contact group
robot.network.gcontact["user"].group.title;
   // get list of contacts from group
robot.network.gcontact["user"].contact.Get("group_ID");
   // get list of contacts from group by name
robot.network.gcontact["user"].contact.GetFromGroupName("group_name");
   // identifiers of the contacts
robot.network.gcontact["user"].contact.ID;
   // titles of the contacts
robot.network.gcontact["user"].contact.title;
   // emails of the contacts
robot.network.gcontact["user"].contact.email;
   // phones of the contacts
robot.network.gcontact["user"].contact.phone;

Other network tools

This function can be useful not only with network part of structure. It utilize UTextTool module.

   // get name of the day of the week
robot.network.GetDayOfTheWeek("date_in");

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation