Jump to content
Sign in to follow this  
tobject

VB source -> to AutoIt Source

Recommended Posts

tobject

I used code I found here on this forum but slightly modified for 3 functions

Post, Follow, Unfollow

need help porting to oAuth, as you know basic stops in August . Thanks. No IE, please, staight API calls

Edited by tobject

Share this post


Link to post
Share on other sites
tobject

Found this TwitterVB for .Net library

http://twittervb.codeplex.com/releases/view/44395

Can someone show me how to port it/use it with Autoit?

Share this post


Link to post
Share on other sites
tobject

Cmon, ladies! 10 days to the deadline

anyone can help me with 3 functions?

Share this post


Link to post
Share on other sites
seandisanti

Cmon, ladies! 10 days to the deadline

anyone can help me with 3 functions?

dude, you haven't asked a question, said what you're trying to do, or where you're having issues. you posted code that you said you got from here and modified. this is a general help and support forum, not a "read my mind" or "do my work" forum. and your deadline means a little less than nothing to me.

Share this post


Link to post
Share on other sites
tobject

It's Twitter Deadline, not mine

Twitter switches to oAuth August 16th

meaning those 3 functions won't work anymore

cameronsdad, be constructive! if you can't help - don't post.

Share this post


Link to post
Share on other sites
seandisanti

It's Twitter Deadline, not mine

Twitter switches to oAuth August 16th

meaning those 3 functions won't work anymore

cameronsdad, be constructive! if you can't help - don't post.

telling you that it's not clear what you're asking and pointing out that you may want to ask differently if you want people to help is being constructive. good luck with your deadline. :blink:

Share this post


Link to post
Share on other sites
tobject

Can I access TwitterVB.dll? http://twittervb.codeplex.com/releases/view/44395#DownloadId=119116

{39DFBB4E-D56E-47A9-9156-F57679DB402D}

How do I access function inside DLL?

Run("rundll32.exe TwitterVB.dll

There are four strings you need for OAuth in TwitterVB
Consumer Key - Twitter gives you this when you register your application at the Twitter OAuth Clients page. 
Consumer Key Secret - Twitter gives you this when you register your application at the Twitter OAuth Clients page. 
OAuth Token - TwitterVB will help you get this. 
OAuth Token Secret - TwitterVB will help you get this. 

Start with a TwitterVB object.
Dim tw As New TwitterVB2.TwitterAPI

Get an authorization link from Twitter.
Dim Url as String = tw.GetAuthorizationLink(ConsumerKey,ConsumerKeySecret)

Your user browses to this URL (or your application opens it for them). This is a Twitter.com URL where the user can authorize your application. When they're done, Twitter gives them a PIN number. Your application must ask the user for that PIN number.

That's all there is to it.
Ask Twitter to confirm that the PIN is correct.
Dim IsValid As Boolean = tw.ValidatePIN(PINNumber)

If the PIN is valid, get the OAuth Tokens.
If IsValid Then 
     Dim OAuthToken as String = tw.OAuth_Token()
     Dim OAuthTokenSecret as String = tw.OAuth_TokenSecret()
End If

http://twittervb.codeplex.com/wikipage?title=OAuth%20Desktop%20Tutorial&referringTitle=OAuth

Edited by tobject

Share this post


Link to post
Share on other sites
tobject

This one does not work

Global $Tw;

Global $ConsumerKey="xxxx";

Global $ConsumerKeySecret="xxxxx";

$Dll=DllOpen("TwitterVB.dll");

$Tw=dllCall($Dll,"handle","TwitterVB2.TwitterAPI");

$sURL=$Tw.GetAuthorizationLink($ConsumerKey,$ConsumerKeySecret)

;$Tw=dllCall($Dll,"str","GetAuthorizationLink","str",$ConsumerKey,"str",$ConsumerKeySecret);

Share this post


Link to post
Share on other sites
seandisanti

This one does not work

Global $Tw;

Global $ConsumerKey="xxxx";

Global $ConsumerKeySecret="xxxxx";

$Dll=DllOpen("TwitterVB.dll");

$Tw=dllCall($Dll,"handle","TwitterVB2.TwitterAPI");

$sURL=$Tw.GetAuthorizationLink($ConsumerKey,$ConsumerKeySecret)

;$Tw=dllCall($Dll,"str","GetAuthorizationLink","str",$ConsumerKey,"str",$ConsumerKeySecret);

details man, "does not work" could mean anything from throws an error to sets your computer on fire. if an error is being returned definitely include the error details, or even search the forums for the error message minus the specific dll info to see if it's an error that's already been solved.

Share this post


Link to post
Share on other sites
tobject

you have to get your hands dirty - download DLL, run the code, see where error is

I hear only Blah Blah Blah - don't waste my time, please.

I need help coding, and you cameronsdad, need a doctor

Share this post


Link to post
Share on other sites
seandisanti

you have to get your hands dirty - download DLL, run the code, see where error is

I hear only Blah Blah Blah - don't waste my time, please.

I need help coding, and you cameronsdad, need a doctor

lol, i don't "have to do" shit, but as the only person responding to your topic maybe i'm just the last one trying to humor you. don't worry, i'll stop.

Share this post


Link to post
Share on other sites
ProgAndy

Just type oAuth in the searchbox and press the green button... Then you'll find a Twitter-UDF with oAuth

http://www.autoitscript.com/forum/index.php?showtopic=116600


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
tobject

I saw that one - it has IE + Javascript

it's like shooting small birds using cannon

plus IE is leacky as always

I prefer staight API

My app fires message every 30 secs

and with oAuth allowing 350/hour I'll probably fire every 15 secs

Share this post


Link to post
Share on other sites
tobject

Question: is there any tools wich at least partially convert VB source to Autoit source?

I'll try to convert TwitterVB to Autoit this weekend

http://twittervb.codeplex.com/SourceControl/list/changesets

Any volunteers?

I started last night with GenerateSignature function

it's not ready yet though

Next will be GenerateSignatureBase

Func GenerateSignature($URL, $ConsumerKey, $ConsumerSecret , $Token ,$TokenSecret , $HTTPMethod , $TimeStamp,
    $Nonce , $SignatureType, ByRef $NormalizedUrl, ByRef $NormalizedRequestParameters, $CallbackUrl, $Verifier )
            $NormalizedUrl = ""
            $NormalizedRequestParameters = ""

            Switch $SignatureType
                Case "PLAINTEXT"
                    Return _UrlEncode(String.Format("%s&%s", $ConsumerSecret, $TokenSecret))

                Case "HMACSHA1"
                    $SignatureBase= GenerateSignatureBase(url, $ConsumerKey, $Token, $TokenSecret, $HTTPMethod, $TimeStamp, $Nonce, HMACSHA1$SignatureType, $NormalizedUrl, $NormalizedRequestParameters, $CallbackUrl, $Verifier)

                    Dim hmacsha1 As New HMACSHA1()
                    $ts=""
                    If $TokenSecret="" Then
                        $ts =""
                    Else
                        $ts = OAuthUrlEncode($TokenSecret)
                    EndIf
                    ;hmacsha1.Key = Encoding.ASCII.GetBytes(StringFormat("{0}&{1}", OAuthUrlEncode($ConsumerSecret), $ts))
                    $Key = StringFormat("%s&%s", OAuthUrlEncode($ConsumerSecret), $ts)
                    Return GenerateSignatureUsingHash($SignatureBase, $Key)

                Case $SignatureTypes.RSASHA1
                    Throw New NotImplementedException()

                Case Else
                    Throw New ArgumentException("Unknown signature type", "$SignatureType")
            EndSwitch
EndFunc

Share this post


Link to post
Share on other sites
AlmarM

Question: is there any tools wich at least partially convert VB source to Autoit source?

I'll try to convert TwitterVB to Autoit this weekend

http://twittervb.codeplex.com/SourceControl/list/changesets

Any volunteers?

I started last night with GenerateSignature function

it's not ready yet though

Next will be GenerateSignatureBase

Func GenerateSignature($URL, $ConsumerKey, $ConsumerSecret, $Token, $TokenSecret, $HTTPMethod, $TimeStamp,
     $Nonce, $SignatureType, ByRef $NormalizedUrl, ByRef $NormalizedRequestParameters, $CallbackUrl, $Verifier)
            $NormalizedUrl = ""
            $NormalizedRequestParameters = ""

            Switch $SignatureType
                Case "PLAINTEXT"
                    Return _UrlEncode(String.Format("%s&%s", $ConsumerSecret, $TokenSecret))

                Case "HMACSHA1"
                    $SignatureBase= GenerateSignatureBase(url, $ConsumerKey, $Token, $TokenSecret, $HTTPMethod, $TimeStamp, $Nonce, HMACSHA1$SignatureType, $NormalizedUrl, $NormalizedRequestParameters, $CallbackUrl, $Verifier)

                    Dim hmacsha1 As New HMACSHA1()
                    $ts=""
                    If $TokenSecret="" Then
                        $ts =""
                    Else
                        $ts = OAuthUrlEncode($TokenSecret)
                    EndIf
                    ;hmacsha1.Key = Encoding.ASCII.GetBytes(StringFormat("{0}&{1}", OAuthUrlEncode($ConsumerSecret), $ts))
                    $Key = StringFormat("%s&%s", OAuthUrlEncode($ConsumerSecret), $ts)
                    Return GenerateSignatureUsingHash($SignatureBase, $Key)

                Case $SignatureTypes.RSASHA1
                    Throw New NotImplementedException()

                Case Else
                    Throw New ArgumentException("Unknown signature type", "$SignatureType")
            EndSwitch
EndFunc

I have no Idea what i'm doing. Is this what you need? ;)

Func GenerateSignature($URL, $ConsumerKey, $ConsumerSecret, $Token, $TokenSecret, $HTTPMethod, $TimeStamp, $Nonce, $SignatureType, ByRef $NormalizedUrl, ByRef $NormalizedRequestParameters, $CallbackUrl, $Verifier)
    Switch $SignatureType
        Case "PLAINTEXT"
            Return _UrlEncode(StringFormat("%s&%s", $ConsumerSecret, $TokenSecret))

        Case "HMACSHA1"
            $SignatureBase = GenerateSignatureBase($URL, $ConsumerKey, $Token, $TokenSecret, $HTTPMethod, $TimeStamp, $Nonce, "HHMACSHA1$SignatureType", $NormalizedUrl, $NormalizedRequestParameters, $CallbackUrl, $Verifier)

            Dim $HMASHA1 = HMACSHA1()
            $ts = ""
            If $TokenSecret = "" Then
                $ts = ""
            Else
                $ts = OAuthUrlEncode($TokenSecret)
            EndIf

            $Key = StringFormat("%s&%s", OAuthUrlEncode($ConsumerKey, $ts)
            Return GenerateSignatureUsingHash($SignatureBase, $Key)

        Case "RSASHA1"
            ConsoleWrite("NotImplentedExeption" & @CRLF)

        Case Else
            ConsoleWrite("Unkown signature type " & $SignatureType & @CRLF)
    EndSwitch
EndFunc
Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
tobject

Thanks.there are 2 more

GetAuthorizationLink

ValidatePIN

and I'm hoping Crypt.au3 has HMACSHA1

Edited by tobject

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.