France
Asked — Edited

Accessing To Some ARC Configuration Information Wjen Buiding A Plugin

Hi

I want in my plugin to get the Media Save Folder Path which is a parameter of Camera Control and to the twitter account name configured in ARC

Do you have ideas ?

Thanks


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

PRO
USA
#1  

Get project control configuration properties:


var formCameraDevice = (FormCameraDevice)EZBManager.FormMain.GetControlByType(typeof(FormCameraDevice)).FirstOrDefault();
if (formCameraDevice == null)
{
    //current project does not have a Camera Device Control 
    return;
}

//Camera's MediaSaveFolder
var cameraMediaSaveFolder = formCameraDevice.GetConfiguration().CameraDevice.CameraMediaSaveFolder;


var formTwitterRecognition = (FormTwitterRecognition)EZBManager.FormMain.GetControlByType(typeof(FormTwitterRecognition)).FirstOrDefault();
if (formTwitterRecognition == null)
{
    //current project does not have a Twitter Recognition Control
    return;
}

//Get Twitter's username
var twitterUserName = formTwitterRecognition.GetConfiguration().TwitterRecognition.TwitterUsername;

PRO
USA
#2  

Twitter Integration:

If your objective is to tweet you can use the the EZ-Script executer: https://synthiam.com/Community/Tutorials/146/21

and send a Tweet command.

ez-script help:

Quote:

Tweet( message ) Send a Twitter message using the configured Twitter account. Configure your Twitter account under File->Twitter Settings. Example: Tweet("I Love EZ-Robot!") You may also use the ControlCommand to Tweet images with text from a Camera Control. Example: ControlCommand( "Camera", CameraTweet, "Our New Image" )

#3  

My objective fot twitter inegration is to be able to send and receive private messages

PRO
USA
#4  

@JLucben,

The existent ez-robot twitter integration does not support direct messages, only DJ knows the ARC priorities.

you can use tweetmoasharp (tweetsharpfork) a .net wrapper: https://github.com/Yortw/tweetmoasharp

you will need to create a twitter application to obtain an Oath consumer key and secret. https://developer.twitter.com/en/docs/basics/authentication/overview/application-permission-model

https://developer.twitter.com/en/docs/basics/authentication/overview/oauth

then something like this:


var service = new TwitterService(consumerKey, consumerSecret, accessToken, accessTokenSecret);
var user = service.VerifyCredentials();
var result = service.SendDirectMessage(recipient, message);

Don't forget the recipient's twitter account must follow your twitter account.

PRO
Synthiam
#5  

The ARC application includes Twitterize, which should support private messaging. Add the DLL to your project as reference, and be sure to set not to copy as you did with ARC.exe and ezb.dll.

PRO
USA
#6  

@JLucben,

Quote:

My objective fot twitter inegration is to be able to send and receive private messages

Another reason to create your twitter application:

User-inserted image

EDIT: I didn't see DJ's post

PRO
USA
#7  

@DJ

For future references, do you allow/recommend using the EZ-Robot application/User tokens ?

Or create a twitter applications and user token ?

PRO
Synthiam
#8  

That’s a good question... I’m guessing it’s not terrible, as it’s the user’s account anyway. So I think it’s probably easiest to use the ezrobot tokens.