MBS FileMaker Plugin Example Databases

Twitter oAuth

All examples are included with download of MBS FileMaker Plugin.

Twitter oAuth.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
oAuth
10 fields defined, 1 record
oAuth

Fields

Table Name: oAuth - 10 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
CONSUMER_KEYNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      CONSUMER_SECRETNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Request_TokenNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              Request_Token_SecretNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  VerifierNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      Access_TokenNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          Access_Token_SecretNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              Screen_NameNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                  MessageNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      ResultNormal, TextAuto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: German

                                          Layout Objects: oAuth

                                          Regular Fields

                                          Field Name: oAuth::CONSUMER_KEY
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 48 pt
                                          • Left: 138 pt
                                          • Bottom: 62 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::CONSUMER_SECRET
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 66 pt
                                          • Left: 138 pt
                                          • Bottom: 80 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Request_Token
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 138 pt
                                          • Left: 138 pt
                                          • Bottom: 152 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Request_Token_Secret
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 156 pt
                                          • Left: 138 pt
                                          • Bottom: 170 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Verifier
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 174 pt
                                          • Left: 138 pt
                                          • Bottom: 188 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Access_Token
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 582 pt
                                          • Left: 138 pt
                                          • Bottom: 596 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Access_Token_Secret
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 600 pt
                                          • Left: 138 pt
                                          • Bottom: 614 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Screen_Name
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 618 pt
                                          • Left: 138 pt
                                          • Bottom: 632 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Message
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 666 pt
                                          • Left: 138 pt
                                          • Bottom: 716 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Field Name: oAuth::Result
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 720 pt
                                          • Left: 138 pt
                                          • Bottom: 770 pt
                                          • Right: 391 pt
                                          • Anchoring: Left, Top
                                          Field Format:
                                          • Edit Box
                                          Field Behavior:
                                          • Allow field to be entered: In Find mode, In Browse mode
                                          • Touch keyboard type: System Default
                                          • Go to next field using: Tab key
                                          Yes

                                          Group Buttons

                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 1. Register your app
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 48 pt
                                          • Left: 426 pt
                                          • Bottom: 73 pt
                                          • Right: 577 pt
                                          • Anchoring: Left, Top
                                          Open URL [ "http://twitter.com/apps" ] [ No dialog ]

                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 2. Request Token
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 90 pt
                                          • Left: 426 pt
                                          • Bottom: 115 pt
                                          • Right: 577 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “RequestToken” ]

                                          Scripts:


                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 3. Load page for Verification
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 162 pt
                                          • Left: 424 pt
                                          • Bottom: 187 pt
                                          • Right: 579 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “LoadPage” ]

                                          Scripts:


                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 4. Access Token
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 600 pt
                                          • Left: 420 pt
                                          • Bottom: 625 pt
                                          • Right: 571 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “AccessToken” ]

                                          Scripts:


                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 5. Post Message
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 666 pt
                                          • Left: 420 pt
                                          • Bottom: 691 pt
                                          • Right: 571 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “SendMessage” ]

                                          Scripts:


                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: 6. Search
                                            Additional Properties:
                                          • Change to hand cursor over button
                                          • Rectangular
                                          • Top: 708 pt
                                          • Left: 420 pt
                                          • Bottom: 733 pt
                                          • Right: 571 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “Search” ]

                                          Scripts:


                                          Web Viewer Controls

                                          Web Viewer Control PropertiesCoordinatesWeb Address
                                            Object Name:
                                          • web
                                            Additional Properties:
                                          • Allow interaction with web viewer content
                                          • Display progress bar
                                          • Display status messages
                                          • Automatically encode URL
                                          • Top: 192 pt
                                          • Left: 12 pt
                                          • Bottom: 577 pt
                                          • Right: 553 pt
                                          • Anchoring: Left, Top

                                          Script Hierarchy

                                          RequestToken
                                          LoadPage
                                          AccessToken
                                          SendMessage
                                          Search

                                          Next Script: [LoadPage]
                                          Script NameRequestToken
                                          Run script with full access privilegesOff
                                          Include In MenuYes
                                          Layouts that use this script
                                          Scripts that use this script
                                            Script Definition
                                            Script Steps
                                            • #Calculate all the parameters
                                            • Set Variable [ $tokenURL; Value:"https://api.twitter.com/oauth/request_token" ]
                                            • Set Variable [ $str1; Value:MBS("String.EncodeURLComponent"; $tokenURL) ]
                                            • Set Variable [ $str1; Value:"POST&" & $str1 & "&" ]
                                            • Set Variable [ $str2; Value:"oauth_consumer_key=" & oAuth::CONSUMER_KEY ]
                                            • Set Variable [ $rs; Value:MBS( "Hash.RandomString"; 32 ) ]
                                            • Set Variable [ $str2; Value:$str2 & "&oauth_nonce=" & $rs ]
                                            • Set Variable [ $str2; Value:$str2 & "&oauth_signature_method=HMAC-SHA1" ]
                                            • Set Variable [ $ts; Value:"" & MBS( "Time.UnixTimeStamp" ) ]
                                            • Set Variable [ $str2; Value:$str2 & "&oauth_timestamp=" & $ts ]
                                            • Set Variable [ $str2; Value:$str2 & "&oauth_version=1.0" ]
                                            • Set Variable [ $str3; Value:oAuth::CONSUMER_SECRET & "&" ]
                                            • Set Variable [ $signature_base_string; Value:$str1 & MBS("String.EncodeURLComponent"; $str2) ]
                                            • Set Variable [ $signature_string; Value:MBS( "Hash.SHA1.HMAC"; $str3; $signature_base_string ; 1) ]
                                            • Set Variable [ $signature_string; Value:MBS("String.EncodeURLComponent"; $signature_string) ]
                                            • Set Variable [ $URL; Value:$tokenURL & "?" & $str2 & "&oauth_signature=" & $signature_string ]
                                            • #Send request with CURL and query result
                                            • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                            • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $URL) ]
                                            • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 0 ) ]
                                            • Set Variable [ $result; Value:MBS( "CURL.SetOptionFollowLocation"; 1 ) ]
                                            • Set Variable [ $result; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 5 ) ]
                                            • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 0 ) ]
                                            • Set Variable [ $result; Value:MBS("CURL.SetOptionCustomRequest"; $curl; "POST") ]
                                            • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                            • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                            • Set Variable [ $resultText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                            • Set Variable [ $headerText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetHeaderAsText"; $curl);1) ]
                                            • Set Variable [ $debugText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1) ]
                                            • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                            • #Pick Result
                                            • Set Variable [ $resultText; Value:$resultText & "&" ]
                                            • Set Variable [ $p1; Value:Position ( $resultText ; "oauth_token=" ; 1 ; 1 ) ]
                                            • Set Variable [ $p2; Value:Position ( $resultText ; "&" ; $p1 ; 1 ) ]
                                            • Set Variable [ $p3; Value:Position ( $resultText ; "oauth_token_secret=" ; 1 ; 1 ) ]
                                            • Set Variable [ $p4; Value:Position ( $resultText ; "&" ; $p3 ; 1 ) ]
                                            • If [ $p1 = 0 or $p2 = 0 or $p3 = 0 or $p4 = 0 ]
                                            • Show Custom Dialog [ Title: "Error"; Message: "Failed to get a token!"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                            • Else
                                            • Set Variable [ $gOAuth_Request_Token; Value:Middle ( $resultText ; $p1+12 ; $p2-$p1-12) ]
                                            • Set Variable [ $gOAuth_Request_Token_secret; Value:Middle ( $resultText ; $p3+19 ; $p4-$p3-19 ) ]
                                            • Set Field [ oAuth::Request_Token; $gOAuth_Request_Token ]
                                            • Set Field [ oAuth::Request_Token_Secret; $gOAuth_Request_Token_secret ]
                                            • End If
                                            Fields used in this script
                                            Scripts used in this script
                                              Layouts used in this script
                                                Tables used in this script
                                                Table occurrences used by this script
                                                Custom Functions used by this script
                                                  Custom menu set used by this script

                                                    Previous Script: [RequestToken]Next Script: [AccessToken]
                                                    Script NameLoadPage
                                                    Run script with full access privilegesOff
                                                    Include In MenuYes
                                                    Layouts that use this script
                                                    Scripts that use this script
                                                      Script Definition
                                                      Script Steps
                                                      • Set Web Viewer [ Object Name: "web"; URL: "https://api.twitter.com/oauth/authorize?oauth_token=" & oAuth::Request_Token ]
                                                      • Loop
                                                      • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                      • Exit Loop If [ MBS("WebView.IsLoading"; "web") ≠ 1 ]
                                                      • End Loop
                                                      Fields used in this script
                                                      Scripts used in this script
                                                        Layouts used in this script
                                                          Tables used in this script
                                                          Table occurrences used by this script
                                                          Custom Functions used by this script
                                                            Custom menu set used by this script

                                                              Previous Script: [LoadPage]Next Script: [SendMessage]
                                                              Script NameAccessToken
                                                              Run script with full access privilegesOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                              Scripts that use this script
                                                                Script Definition
                                                                Script Steps
                                                                • Set Variable [ $tokenURL; Value:"https://api.twitter.com/oauth/access_token" ]
                                                                • #Calculate all the parameters
                                                                • Set Variable [ $str1; Value:MBS("String.EncodeURLComponent"; $tokenURL) ]
                                                                • Set Variable [ $str1; Value:"POST&" & $str1 & "&" ]
                                                                • Set Variable [ $str2; Value:"oauth_consumer_key=" & oAuth::CONSUMER_KEY ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_nonce=" & MBS( "Hash.RandomString"; 32) ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_signature_method=HMAC-SHA1" ]
                                                                • Set Variable [ $ts; Value:MBS( "Time.UnixTimeStamp") ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_timestamp=" & $ts ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_token=" & oAuth::Request_Token ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_verifier=" & oAuth::Verifier ]
                                                                • Set Variable [ $str2; Value:$str2 & "&oauth_version=1.0" ]
                                                                • Set Variable [ $str3; Value:oAuth::CONSUMER_KEY & "&" & oAuth::Request_Token_Secret ]
                                                                • Set Variable [ $signature_base_string; Value:$str1 & MBS( "String.EncodeURLComponent"; $str2) ]
                                                                • Set Variable [ $signature_base_string; Value:MBS( "Hash.SHA1.HMAC"; $str3; $signature_base_string; 1) ]
                                                                • Set Variable [ $signature_string; Value:MBS("String.EncodeURLComponent"; $signature_base_string) ]
                                                                • Set Variable [ $URL; Value:$tokenURL & "?" & $str2 & "&oauth_signature=" & $signature_string ]
                                                                • #Send request with CURL and query result
                                                                • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $URL) ]
                                                                • Set Variable [ $result; Value:MBS( "CURL.SetOptionFollowLocation"; 1 ) ]
                                                                • Set Variable [ $result; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 5 ) ]
                                                                • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 0 ) ]
                                                                • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 0 ) ]
                                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionCustomRequest"; $curl; "POST") ]
                                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                                • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                • Set Variable [ $resultText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                                                • Set Variable [ $headerText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetHeaderAsText"; $curl);1) ]
                                                                • Set Variable [ $debugText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1) ]
                                                                • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                • #Pick Result
                                                                • Set Variable [ $resultText; Value:$resultText & "&" ]
                                                                • Set Variable [ $p1; Value:Position ( $resultText ; "oauth_token=" ; 1 ; 1 ) ]
                                                                • Set Variable [ $p2; Value:Position ( $resultText ; "&" ; $p1 ; 1 ) ]
                                                                • Set Variable [ $p3; Value:Position ( $resultText ; "oauth_token_secret=" ; 1 ; 1 ) ]
                                                                • Set Variable [ $p4; Value:Position ( $resultText ; "&" ; $p3 ; 1 ) ]
                                                                • Set Variable [ $p5; Value:Position ( $resultText ; "screen_name=" ; 1 ; 1 ) ]
                                                                • Set Variable [ $p6; Value:Position ( $resultText ; "&" ; $p5 ; 1 ) ]
                                                                • If [ $p1 = 0 or $p2 = 0 or $p3 = 0 or $p4 = 0 ]
                                                                • Show Custom Dialog [ Title: "Error"; Message: "Failed to get a token!"; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                • Else
                                                                • Set Variable [ $gOAuth_Access_Token; Value:Middle ( $resultText ; $p1+12 ; $p2-$p1-12) ]
                                                                • Set Variable [ $gOAuth_Access_Token_Secret; Value:Middle ( $resultText ; $p3+19 ; $p4-$p3-19 ) ]
                                                                • Set Variable [ $gScreen_Name; Value:Middle ( $resultText ; $p5+12 ; $p6-$p5-12 ) ]
                                                                • Set Field [ oAuth::Access_Token; $gOAuth_Access_Token ]
                                                                • Set Field [ oAuth::Access_Token_Secret; $gOAuth_Access_Token_Secret ]
                                                                • Set Field [ oAuth::Screen_Name; $gScreen_Name ]
                                                                • End If
                                                                Fields used in this script
                                                                Scripts used in this script
                                                                  Layouts used in this script
                                                                    Tables used in this script
                                                                    Table occurrences used by this script
                                                                    Custom Functions used by this script
                                                                      Custom menu set used by this script

                                                                        Previous Script: [AccessToken]Next Script: [Search]
                                                                        Script NameSendMessage
                                                                        Run script with full access privilegesOff
                                                                        Include In MenuYes
                                                                        Layouts that use this script
                                                                        Scripts that use this script
                                                                          Script Definition
                                                                          Script Steps
                                                                          • #Calculate all the parameters
                                                                          • Set Variable [ $api; Value:"https://api.twitter.com/1.1/statuses/update.json" ]
                                                                          • Set Variable [ $type; Value:"POST" ]
                                                                          • Set Variable [ $message; Value:MBS( "String.EncodeURLComponent"; oAuth::Message) ]
                                                                          • Set Variable [ $message; Value:"status=" & $message ]
                                                                          • Set Variable [ $optionA; Value:"" ]
                                                                          • Set Variable [ $optionB; Value:$message ]
                                                                          • #After the message, built the values for hash
                                                                          • Set Variable [ $str1; Value:$api ]
                                                                          • Set Variable [ $str1; Value:MBS( "String.EncodeURLComponent"; $str1) ]
                                                                          • Set Variable [ $str1; Value:$type & "&" & $str1 & "&" ]
                                                                          • If [ Length ( $OptionA )>0 ]
                                                                          • Set Variable [ $str2; Value:$str1 & $optionA & "&" ]
                                                                          • End If
                                                                          • Set Variable [ $str2; Value:$str2 & "oauth_consumer_key=" & oAuth::CONSUMER_KEY ]
                                                                          • Set Variable [ $rs; Value:MBS("Hash.RandomString"; 32) ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&oauth_nonce=" & $rs ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&oauth_signature_method=HMAC-SHA1" ]
                                                                          • Set Variable [ $timestamp; Value:MBS( "Time.UnixTimeStamp") ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&oauth_timestamp=" & $timestamp ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&oauth_token=" & oAuth::Access_Token ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&oauth_version=1.0" ]
                                                                          • If [ Length ( $OptionB )>0 ]
                                                                          • Set Variable [ $str2; Value:$str2 & "&" & $optionB ]
                                                                          • End If
                                                                          • Set Variable [ $str3; Value:oAuth::CONSUMER_SECRET & "&" & oAuth::Access_Token_Secret ]
                                                                          • Set Variable [ $signature_base_string; Value:$str1 & MBS( "String.EncodeURLComponent"; $str2) ]
                                                                          • Set Variable [ $hmacsha1; Value:MBS( "Hash.SHA1.HMAC"; $str3; $signature_base_string; 1) ]
                                                                          • Set Variable [ $signature_string; Value:MBS("String.EncodeURLComponent"; $hmacsha1) ]
                                                                          • Set Variable [ $URL; Value:$api & "?" & $str2 & "&oauth_signature=" & $signature_string ]
                                                                          • #Send request with CURL and query result
                                                                          • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $URL) ]
                                                                          • Set Variable [ $result; Value:MBS( "CURL.SetOptionFollowLocation"; 1 ) ]
                                                                          • Set Variable [ $result; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 5 ) ]
                                                                          • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 0 ) ]
                                                                          • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 0 ) ]
                                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionCustomRequest"; $curl; "POST") ]
                                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                                          • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                          • Set Variable [ $resultText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                                                          • Set Variable [ $headerText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetHeaderAsText"; $curl);1) ]
                                                                          • Set Variable [ $debugText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1) ]
                                                                          • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                          • #Pick Result
                                                                          • Set Field [ oAuth::Result; $resultText ]
                                                                          Fields used in this script
                                                                          Scripts used in this script
                                                                            Layouts used in this script
                                                                              Tables used in this script
                                                                              Table occurrences used by this script
                                                                              Custom Functions used by this script
                                                                                Custom menu set used by this script

                                                                                  Previous Script: [SendMessage]
                                                                                  Script NameSearch
                                                                                  Run script with full access privilegesOff
                                                                                  Include In MenuYes
                                                                                  Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • #Calculate all the parameters
                                                                                    • Set Variable [ $api; Value:"https://api.twitter.com/1.1/search/tweets.json" ]
                                                                                    • Set Variable [ $type; Value:"GET" ]
                                                                                    • Set Variable [ $message1; Value:MBS( "String.EncodeURLComponent"; oAuth::Message) ]
                                                                                    • Set Variable [ $message; Value:"count=5&include_entities=true&q=" & $message1 & "&result_type=mixed" ]
                                                                                    • Set Variable [ $optionA; Value:"count=5&include_entities=true" ]
                                                                                    • Set Variable [ $optionB; Value:"q=" & $message1 & "&result_type=mixed" ]
                                                                                    • #After the message, built the values for hash
                                                                                    • Set Variable [ $str1; Value:$api ]
                                                                                    • Set Variable [ $str1; Value:MBS( "String.EncodeURLComponent"; $str1) ]
                                                                                    • Set Variable [ $str1; Value:$type & "&" & $str1 & "&" ]
                                                                                    • If [ Length ( $OptionA )>0 ]
                                                                                    • Set Variable [ $str2; Value:$str2 & $optionA & "&" ]
                                                                                    • End If
                                                                                    • Set Variable [ $str2; Value:$str2 & "oauth_consumer_key=" & oAuth::CONSUMER_KEY ]
                                                                                    • Set Variable [ $rs; Value:MBS("Hash.RandomString"; 32) ]
                                                                                    • // Set Variable [ $rs; Value:"2715bce5824b7f031cf2f28757103d3c" ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&oauth_nonce=" & $rs ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&oauth_signature_method=HMAC-SHA1" ]
                                                                                    • Set Variable [ $timestamp; Value:MBS( "Time.UnixTimeStamp") ]
                                                                                    • // Set Variable [ $timestamp; Value:"1371061854" ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&oauth_timestamp=" & $timestamp ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&oauth_token=" & oAuth::Access_Token ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&oauth_version=1.0" ]
                                                                                    • If [ Length ( $OptionB )>0 ]
                                                                                    • Set Variable [ $str2; Value:$str2 & "&" & $optionB ]
                                                                                    • End If
                                                                                    • Set Variable [ $str3; Value:oAuth::CONSUMER_SECRET & "&" & oAuth::Access_Token_Secret ]
                                                                                    • Set Variable [ $signature_base_string; Value:$str1 & MBS( "String.EncodeURLComponent"; $str2) ]
                                                                                    • Set Variable [ $hmacsha1; Value:MBS( "Hash.SHA1.HMAC"; $str3; $signature_base_string; 1) ]
                                                                                    • Set Variable [ $signature_string; Value:MBS("String.EncodeURLComponent"; $hmacsha1) ]
                                                                                    • Set Variable [ $URL; Value:$api & "?" & $message ]
                                                                                    • // Set Variable [ $URL; Value:$api & "?" & $str2 & "&oauth_signature=" & $signature_string ]
                                                                                    • Set Variable [ $Header; Value:"Authorization: OAuth oauth_consumer_key=\"" & oAuth::CONSUMER_KEY & "\", oauth_nonce=\"" & $rs & "\", oauth_signature=\"" & $signature_string & "\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"" & $timestamp & "\", oauth_token=\"" & oAuth::Access_Token & "\", oauth_version=\"1.0\"" ]
                                                                                    • #Send request with CURL and query result
                                                                                    • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $URL) ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; $Header) ]
                                                                                    • Set Variable [ $result; Value:MBS( "CURL.SetOptionFollowLocation"; 1 ) ]
                                                                                    • Set Variable [ $result; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 5 ) ]
                                                                                    • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 0 ) ]
                                                                                    • Set Variable [ $result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 0 ) ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionCustomRequest"; $curl; "GET") ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                                    • Set Variable [ $resultText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                                                                    • Set Variable [ $headerText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetHeaderAsText"; $curl);1) ]
                                                                                    • Set Variable [ $debugText; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1) ]
                                                                                    • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                                    • #Pick Result
                                                                                    • Set Field [ oAuth::Result; $resultText ]
                                                                                    Fields used in this script
                                                                                    Scripts used in this script
                                                                                      Layouts used in this script
                                                                                        Tables used in this script
                                                                                        Table occurrences used by this script
                                                                                        Custom Functions used by this script
                                                                                          Custom menu set used by this script

                                                                                            Download example: Twitter oAuth

                                                                                            Used functions:




                                                                                            Links
                                                                                            MBS Xojo Chart Plugins