steelersfan 38 Posted November 2, 2016 Report Share Posted November 2, 2016 I want to use a twitter search selection in my UI, and I named the values with normal names (Tweets, Users, etc.). However, the problem is that the operands in twitter search are: f=tweets f=users etc. Is there a simple way to tie each variable name to the corresponding search operand? I know that I could just put the operands into the UI, but I want the end users to see normal text, and I know that I can use an if statement for each, but I want to use as little code to achieve this as possible. What is a good and simple way to achieve this? Example Code: ui text box("Twitter Search Term:",#twit search term) ui list box("Search Types:","Tweets,Users,Images,Videos,News,All",#search type) ui drop down("Language:","English,Spanish,French,German",#search language) navigate("https://twitter.com/search?{#search type}&q={#twit search term}{#search language}","Wait") wait($rand(1,3)) So as it is now, I just have the UI variables set, and the navigate uses the variables to fill in the parts of the search URL that I want to have selectable by the end user. Is there a better way to do this? I don't like using the method that fills in the search box manually, as it is more complicated and cumbersome than just appending a search URL. Quote Link to post Share on other sites
pash 504 Posted November 3, 2016 Report Share Posted November 3, 2016 Option 1 ui text box("Twitter Search Term:",#twit search term) ui list box("Search Types:","Tweets,Users,Images,Videos,News,All",#search type) ui drop down("Language:","English,Spanish,French,German",#search language) in shared browser { set visibility("Invisible") navigate("https://twitter.com/search?{#search type}&q={#twit search term}{#search language}","Wait") wait for browser event("Everything Loaded","") wait(1) set(#Html,$document text,"Global") } load html(#Html) wait($rand(1,3)) Option 2 Quote Link to post Share on other sites
steelersfan 38 Posted November 3, 2016 Author Report Share Posted November 3, 2016 Thank you Pash! Unfortunately, that is not what I was asking though. I want to understand a way to alter variables. Like for example, any given variable that has multiple options (Values separated by commas), the variable becomes the values set in the UI element. I want to display a specific set of variables in the dropdown or list box, but then have that variable set to a different text string. For example: "Tweets" in the dropdownBecomes "f=tweets" when the variable is passed to the navigate command. Sorry if I was confusing in the OP, it is an obscure request, I know. Quote Link to post Share on other sites
pash 504 Posted November 3, 2016 Report Share Posted November 3, 2016 like this?http://network.ubotstudio.com/forum/index.php/topic/17528-ui-html-dropdown-values-from-variable-resolved/?p=107897 Quote Link to post Share on other sites
steelersfan 38 Posted November 3, 2016 Author Report Share Posted November 3, 2016 like this?http://network.ubotstudio.com/forum/index.php/topic/17528-ui-html-dropdown-values-from-variable-resolved/?p=107897No, not that. Switching variable output from what is displayed in the UI. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.