[MUSIC]
>> Hey, what's up?
It is Michael here.
Today, I'm going to take a look
at a little experiment that I wanted to trap that
would allow me to do things with
Logic Apps and with social media posting.
Let's go ahead and let's talk a
tiny bit more about the problem at hand.
I'd use software that is called Streamlabs OBS,
and that takes care of my stream and I also would use
another piece of software that is called Stream Deck.
So all other machine,
I think I have it installed here.
So this isn't the profile that I currently use.
What I'm currently doing is just that I have one PC,
this running Windows 10 that handles all my streaming stuff.
Then I have this other Mac that
I primarily do a lot of my other top of workout.
So I've separated out the stream to
where my main PC is not taking,
it's not taking too much of a processing power yet.
So one of the things that I wanted to do is
that whenever I start a string,
currently, it walks through this process,
which is right here, it's in Twitter.
I'm going to double-click on this
and you'll see that it does things such as,
changes your name over here.
Here's the Tweet that goes out.
I'm live now on Twitch talk in Azure App Dev and more.
Come hang out with me and we'll learn together.
Once I start to stream,
I want to do things such as,
I want to change the name,
our profile name and you can see it up here.
I want to change the name to put
the little recorded emoji and then say
[inaudible] now, and then I've got to
delace it just in case it needs it.
Then the next step is Twitter, tweet.
So this Tweets the stream out to my followers.
I'd like for this to also post out to LinkedIn.
LinkedIn is not like a built-in connector here.
So for example, if I do like Twitter,
you could see that things like tweet,
change, name, all that type of stuff is already available.
Also, since the software in and of itself,
it doesn't allow you to even add an account for that.
So I'm going to come back to Stream Deck.
Let's minimize this other window here.
So if I go to Stream Deck and I
even look at the different types of accounts,
so I'm going to Click down on this.
I'm going to Click "Add an account," I do not want that.
If I tried to add an account here, and again,
I'm trying to host and go over here to Properties.
I'm going to go to Properties on this window,
and now I'm going to Hit "Done."
Oh, and by the way,
Rainbow Rentein has joined us.
Hey Ren, what's up?
So what I was doing just a second ago, was that,
I am looking for a way to be able to use
Stream Deck to automatically post
out to Twitter and also to LinkedIn.
So the current issue is that,
it only currently works with
Twitter and these services underneath here.
Mixer, Streamlabs, Twitch, Twitter or YouTube.
That's okay. What we're going to do is,
I'm going to try to add in
that functionality and I'm going to try to do that
using the great and the wonderful Azure Logic Apps.
I'm going to close out of this,
and this will leave open,
because what I'd like to do is,
I'd like to put another step in here.
There is a browse,
there's this Website task.
This Website task is going to
be what we're going to want to use here.
Let's go ahead and close out of this and let's go into Azure.
I want to go portal.Azure.com.
Just set a marker.
What I'm currently doing is,
we're going to use Logic Apps to post out to
LinkedIn whenever we go live. Okay, Ren.
The first thing that we're going to need is,
we're going to need a resource group and you can think about
a resource group as something that is like this container,
of all of the different types
of our services that we're going to put inside of it,
like App Service or Logic Apps, etc.
So I'm going to go in here and I'm going to pick
one of my subscriptions.
I will actually pick this,
since it is something I'd just plan with,
in this other account,
which is my Enterprise account.
This is the free money that I get per week.
So I'm going to go into Stream Deck.
But now, it's set to Central US.
We're going to go to West US and we're going to
go Review and Create and we Hit "Create" perfect.
So now, what we have is,
we actually have our Resource group
that we're going to add stuff inside of it.
So I'm going to scroll down and I am going to go to,
there we go, Stream Deck RG.
I've got a Resource group that's already been built out.
Now, I need to actually fill it with a Logic App.
In order to do that,
I am going to simply go
Add and what do you think I would search for right here, Ren?
>> Add Logic App.
>> Yes, that is correct.
Logic App.
I'm going to go create here.
So what I am doing here is
I am trying to use Stream Deck,
to update my LinkedIn status.
Currently, Stream Deck does not support that,
so I thought I would just use Logic Apps as it's super-fast.
What I've done so far is,
we have an HTTP post Schema that's in here.
We started creating our own Schema tool.
Currently doing is, I am going to clean up the JSON Schema a bit.
We're going to have two fields.
One we're just going to use for LinkedIn,
we may add this in another episode.
Then the other one is going to be called,
for example, like Twitter.
We're just going to have these as two values.
So it can be a value of one or zero.
One means active and that you should Tweet about it,
and one is active and you should Tweet about it,
and zero would be like no.
So I'm going to grab this JSON.
Now, I'm going to come back over to my Logic App Designer,
and I'm just going to use a sample payload here.
So LinkedIn, Twitter, we can hit "Done" here.
What it did was it just went ahead
and put together the JSON Schema.
So you can see we've got an object in its expected two properties,
got Linkedin Integer, Twitter integer.
If we go down here to create a different perimeter,
we're going to Click on "Method"
inside a method This is going to be a,
let's see if we can just back out a method here.
We're going to use a GET.
So basically we are going to call this URL that it generates.
I don't need a response to come back.
So this is, for example,
if we wanted to send something back to you, you could do that.
I don't need that. So that's going to be
the request coming in
and I'm just going to go ahead and hit "Save."
Hopefully, that saves properly, and it looks like it did.
Then we're going to have a status code of 200,
which gave us this one completely by default.
So you can think of 200 means it basically was successful.
You could have a bunch of other status codes,
like a status code of 400.
If you had a status code of 400,
well, that means it was a bad request.
If I save this right now,
and I'm going to go ahead and I'm going to
copy this URL out of here.
If we run this URL,
we can see that it just returned successful.
The reason that just returns successful,
is because that's what we typed in to our body.
So now, I would like to go back in here, Click "Insert."
We're going to add an action.
This is where I think the power of some of
the Logic App stuff really shines through.
So I could now type in LinkedIn.
There's two versions of the LinkedIn API.
There's a LinkedIn version 1 and
then there is another LinkedIn like a V2.
The other reason I know about this is that,
I actually found a bug when LinkedIn first switched over to V2.
Linked, okay, that's the one that we're going to want.
We're going to want LinkedIn V2,
and what we want to do is we want to share an article,
we're going to need to sign in before it let us do that.
It has been a really long time
since I actually did this or logged in,
I have been logged in for so long on one machine, it's crazy.
What we want to do is we want to share out our string.
So I'm just going to go https://Twitch.tv,
we're going to get mbcrumb.
Obviously, we want this to be available,
visible to guests or not,
we definitely want that to be visible to guest.
So for the title,
we're going to want the tittle and we're going to want
the description at least for right now,
so title of the content being shared.
So before, I was using
Stream Deck and it had some at the content that I wanted.
We'll go back to configure Stream Deck,
and I'm going to copy some of this.
What I wanted to do is I wanted to say title,
title is I'm Live Now.
I'm Live Now, and I think I need this space right here.
I'm Live Now, and
actually I'm going to make this a little bit more specific,
and I'm just going to say I'm Live Now from Twitch.
The description of the content being
shared is where I'm going to go back in here.
Oops, that one, I don't want that.
I do want this one again, Configure, go here.
What I'm going to do is I'm going to copy most of this,
all of this text really.
Do a Control C here,
and this is the description.
So I typically do like, "Hey folks."
We're going to go, "Hey folks,
I'm Live Now on Twitch talking Azure app development and more.
Come and hang out with me and maybe my daughter.
Ask questions and we'll learn together."
That's kind of my style, we ask questions
and then we just learn everything together.
So I think that's really it.
Let's save this, and we already have the URL over here.
Let's go ahead and log in to LinkedIn.
So I should be able to hit
this URL and it should actually post it for me.
It did come back saying successful again.
So it did tweet it out,
I'm Live Now on Twitch,
but it really didn't put that description in there like we wanted.
So let's take this post and let's go ahead and delete it.
Once I delete it, I'm going to come back over to
this and let's see if there is another parameter that was here,
Title, Description, Text of the share.
Well, maybe I wanted this,
so I'm going to save this,
and now, that I've saved this one,
I'm going to come back over here and
let's go ahead and see if this works.
So we know that at least the API calls
returns successful by using Logic Apps.
I was able to pretty quickly get this up and running.
Server did not receive a response.
So sometimes it does that,
the LinkedIn API kicks back,
if you're calling it too frequent,
and I don't know what the frequency is.
Let's go over here.
I'm going to see myself in a browser,
seeing myself with an image of myself.
That was pretty easy.
So now, I've got a URL and what I'll probably want to do is I
probably wanted to take in this URL in
regenerating the SAS tokens,
because now I could come back over here into,
go back into this Configure Stream Deck,
we're going to clear that out, we're going to go back up.
Actually, we could go right here, we're just testing it.
I can do browser or website.
Probably, I would want to have a delay in here.
So let me go ahead and let's drop a delay,
we're going to put the delay right there.
Delay is a second,
and now, we have the ability that we can access
this URL completely in the background using this multiple task,
which is pretty cool and it's pretty simple.
You saw my Stream Deck that's running over here on the Mac,
which I'm not using that setup at all anymore,
but over on my other main machine,
I'm going to use this same URL.
So I'm going to go here and I'm going to go into delay.
Basically, I'm just re-copying and
pasting all of this information to another URL.
I'm going to put in the delay and I'm about to put in the website,
I'm just going back and getting that URL.
Remember that URL has a SAS token.
We don't want that to leak out because that means
anybody could call this API.
So you can also regenerate those tokens,
which I may show you in just a second.
So I'm going to go back in and go back in to our Logic Apps.
Sorry, you can't see what I'm doing right now at the moment,
and I'm going to now go back in and grab that http.
So I finally got the URL,
I'm going back to website.
I'm creating the website over here on
the other machine, can't show history.
So this is Stream Deck.
By the way, I don't know what was necessarily the best way.
This is just me playing around, at least for the moment,
and I'm also going to grab website here,
this is going to be LinkedIn.
Let's see how well this actually works.
I'm going to close this one.
I'm going to come back here and I'm pretty
sure that there is some limits.
I know you can't do the same exact thing,
so we'll need to delete that.
I'm going to refresh my history.
Once I refresh my history, so it shows that.
So now, I have created that button.
So I'm going to go ahead and I'm going to
press that button, okay I did.
I put it to access in the background,
I put it in the background.
So let's go to Stream Deck access and background.
Maybe I can't access it that way.
So I'm going to try another way.
I'm getting those rate limits again,
let's go back over here to the Designer.
You should be able to see that
it has failed a couple of times here.
If you look at the status,
content is a duplicate of another URL that was shared.
So we could actually fix this very
quickly by coming into the message and tweaking it a bit.
Again, I'm going to keep the access in background.
So if we come back over to our Logic Apps and we go
to LinkedIn Updater and we go to the Designer Mode,
I'm Live Now on Twitch.
Hey folks. Let's just change
this one little bit here, the and more.
Let's save this, and now we'll have a totally different message.
LinkedIn's API, it sometimes
takes a little while for it to be updated and
completely cleared out of the queue even though
that status isn't there anymore before the API will return,
it's not duplicate content.
I think you got to wait like a day or so. So let's try it again.
I'm hitting the button on my Stream Deck called LinkedIn Updater.
It's going to basically hit this API.
There it's exceeded, so now, we should be able to see it.
That was pretty cool,
that was pretty fast since the Stream Deck did not have a way to
configure an account for LinkedIn since all that it supported was,
and I don't need that, all that it is supported was Mixer,
Streamlabs, Twich Twitter, and YouTube,
also wanted to pose to LinkedIn.
So I was able to do that simply by going to Azure,
creating a resource group.
Once I created the resource group,
I used a Logic App and I did a "When
a HTTP request is received," this is for maybe some future use.
Right now, I'll put in LinkedIn's expecting
an integer and then Twitter's
obviously expecting an integer as well.
The method here, which just simply a GET.
So that means when you hit the URL,
we need to get a response,
and this one came with it.
I use this template.
So status code 200, everything went perfect,
everything went fine here,
the body just says successful.
Then I used one of the connectors.
So there is a ton of
different connectors that's absolutely that's out there.
So what it did was,
I clicked LinkedIn V2.
I gave it the URL,
I want it to be visible to everybody.
I gave it a title and a little bit of text here.
After I saved this,
this right here is the GET URL.
So I was able to copy that GET URL over
into my Stream Deck Configuration as just simply a website,
I pasted in the URL that came from Azure Logic App,
and then I just selected Access in background.
Now, I'm able to update
my status to LinkedIn whenever I get online.
That was actually pretty cool.
I do appreciate those who were hanging out with me.
If anybody's got any questions,
I'll hang around for a minute or two,
but that is primarily what I wanted to.