The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Publishing Twitter Link to Web App via Macro
I am trying configure my web app to have a link to a Twitter user's profile. In the main page of my web app, I have a bar graph of count of tweets by user name. These user names are just display names and I have a data set where the user names are associated to the user screen names (unique twitter handles). To access a twitter profile, the URL is twitter.com/*userscreenname* - it will bring you directly to the user's twitter page.
In the main screen of the web app, a user can click on the user name to see a more detailed report of their tweets. This click on one of the user names in the bar graph then triggers three interactions: 1. store the user name as a macro, userName, 2. run a process that filters the twitter data to just that user name and 3. navigate to a new view in the web app where the more detailed visualizations of tweets by that user are displayed. On this more detailed display, I added an "external resource" component, configured as below:
Embedding the page as an image returns nothing and the "show link" check box gives me the below, which is all I'm looking for. I chose not to use IFRAME because I do not need a preview of the user's page
The click on the user name stores it as a macro on the main screen, but as I said above, it is just the display name, not the user screen name, which is the unique identifier to tack onto the end of the twitter url, thus I added a macro to my process that recalculates the tweet to store the filtered user's screen name as macro, userScreenName. The macro is initialized to "null" in the RM process via the Context panel.
When I click on the twitter link, it leads me to a link that is just *twitter.com/?=*, which then reloads to *twitter.com/home?=*
So - there are two issues here: 1. URL template link adds additional characters that are not in the original text entered in the URL template and 2. the process that in theory should store the userScreenName macro (process filters to one individual user and then stores their unique screen name as macro userScreenName), does not pull through the stored value as the macro since nothing gets pulled through on the tail end of the link.
Any help with the above two issues would be appreciated! Thanks.
In the main screen of the web app, a user can click on the user name to see a more detailed report of their tweets. This click on one of the user names in the bar graph then triggers three interactions: 1. store the user name as a macro, userName, 2. run a process that filters the twitter data to just that user name and 3. navigate to a new view in the web app where the more detailed visualizations of tweets by that user are displayed. On this more detailed display, I added an "external resource" component, configured as below:
Embedding the page as an image returns nothing and the "show link" check box gives me the below, which is all I'm looking for. I chose not to use IFRAME because I do not need a preview of the user's page
The click on the user name stores it as a macro on the main screen, but as I said above, it is just the display name, not the user screen name, which is the unique identifier to tack onto the end of the twitter url, thus I added a macro to my process that recalculates the tweet to store the filtered user's screen name as macro, userScreenName. The macro is initialized to "null" in the RM process via the Context panel.
When I click on the twitter link, it leads me to a link that is just *twitter.com/?=*, which then reloads to *twitter.com/home?=*
So - there are two issues here: 1. URL template link adds additional characters that are not in the original text entered in the URL template and 2. the process that in theory should store the userScreenName macro (process filters to one individual user and then stores their unique screen name as macro userScreenName), does not pull through the stored value as the macro since nothing gets pulled through on the tail end of the link.
Any help with the above two issues would be appreciated! Thanks.
0
Best Answer
-
Edin_Klapic Employee-RapidMiner, RMResearcher, Member Posts: 299 RM Data ScientistSorry @Dayna22 ,It seems I had a typoIt should be href="https..... and not href=""https...Then it works.Happy Mining,EdinP.S.An alternative solution would be to use a Text component.
1
Answers
The issue that still persists is the url: the link is now calculating as *twitter.com/?=*userScreenName* when it should be *twitter.com/*userScreenName* - this is causing the twitter page to not be found.
Why is the "?=" automatically being added to the link?
Thanks!
A solution would be to manually write the text (either as ExampleSet or via Create Document (text extension)). In both solutions you would need to put the output settings to HTML and enable "raw HTML".
<a href=""https://twitter.com/%{userScreenName}" target="_blank">Click here to see the Twitter profile of %{userScreenName}</a>
where target="_blank" makes the link open in a new tab.
Happy Mining and Stay safe and Healthy,
Edin
Instead or in addition to the link text you could use an image.
The visualization is then showing the correct link text: twitter.com/*userScreenName* on the preview screen, but when hovering over the link address, copying the link address, or clicking on the link address, it shows our server URL with a multitude of text and characters after the initial domain, not the twitter URL. Is there something I am missing here?
Thanks!!