Loading and running an external webpage - javascript

I have been asking this question in different places but couldn't get a real answer.
Here is the problem:
Let say I have a web page which is going to serve like google. I mean it will use google at the bacground but foreground will be my page. It will contain a textbox and a button. So a user will come and enter a text that he wants to search and click the button to submit the query. So my webpage will transfer this search text to the google at the background and search the thing in google. It will return the results to my webpage in a different form. `
So the question is, what is the best way of implementing this and more importantly is it possible.
Many thanks.

You will have to use Google Custom Search API: https://developers.google.com/custom-search/v1/overview
You cannot use classic web crawler techniques to get the data from Google since that violates their TOS.

Related

Search box to search another site

I've been tasked to replicate the search on http://www.hefce.ac.uk/postcode/
in one of our sites and wondered if it's possible to do this by having a search box in our site and every time a user clicks it will pull the results from the HEFCE site and display on ours, or to simply redirect to the HEFCE site with results?
Many thanks!
Well, the easiest thing you can do is just use Google CSE and embed it in your site. It's an easy tool where you can just insert the path of the HEFCE site, and it creates the search engine you need.

show contents of link

I've been searching the internet to get some information about how i can be able to detect and show what a url is about.
Facebook has a good example of what i actually want to achieve:
If you create a update on facebook and paste in a URL, facebook will detect some information about it and show a box with some text and often the right picture.
for instance, take: http://www.ebay.com/itm/Mens-Monk-Strap-Loafers-Suede-Lined-Metal-Buckle-Slip-Casual-Dress-Shoes-New-/311170422772 . then it shows the image of the shoe and headline.
Ive found other services which does this with image services and youtube, but what i need is about getting information of products most of the time, so often urls from shops. So the user pastes in a url, and i can detect what that link is about.
any ideer how this can be done ?
Is it backend code, like c# or javascript ?
Hopefully some of you can point me in the right direction. Thanks in advance!
Facebook scrapes pages for specific metadata in the back-end and uses it to generate the snippets you see, which can either be served along with the initial page load or brought in via JavaScript (front-end). From there it's a matter of using CSS and JS to style the popup to your liking.
Depending on how inter-related your site is with the content you want to display, this can be an easy task or a difficult one.

Qualtrics Embeds read by iFrame for GA

Thanks for taking a look at this. My task at hand is to put a html page in qualtrics, as an iframe (is the current thinking), and from that to see if I can get user data through event tracking to be sent to Google Analytics. So far, I understand how to send events to GA, and I'm working on the Custom Dimensions, but I have to wait a day to see if that's worked.
What I need though, is a unique ID, which I generate with qualtric's random number generator php. I need this unique ID to be sent to Google Analytics so that I can identify who's doing what on the embedded page. So I've looked at the Qualtrics javascript stuff, and I can get qualtrics itself to generate the id through javascript:
<script language="javascript">
var user = '${e://Field/user}';
document.write (user);
</script>
This works to just display the number in Qualtrics, but I know I'm missing a huge step, because implementing the same thing in an embedded webpage won't work - will it? I've tried, without success, and I've even used the
Qualtrics.SurveyEngine.addOnload(function()
{});
without success.
If you have any suggestions, that would keep the user in Qualtrics, but pass the embedded data for a unique individual's user events on an embedded webpage to GA, I'm all ears. Any reconceptualizing is cool to.
I'm just trying to figure out who is doing what on my embedded pages (iframed webpages) in Qualtrics.
Maybe this source will help: http://ut1.qualtrics.com/WRAPI/QuestionAPI/classes/Qualtrics%20JavaScript%20Question%20API.html
Thank you very much for any advice or direction.

block web parts in sharepoint from certain users

I'm looking to see if it's possible to block certain data in web parts from loading or showing for certain users?
I have a SharePoint page that was written in asp.net and JavaScript. What i have is a page that runs several queries and displays them as separate web parts. I would like to be able to block certain web parts that show financial information to only show for the managers group.
I am able to just hide the web part from showing at all but that isn't necessarily helpful.
any help at all would be greatly appreciated.
thank you!
I would create a hidden div that contains the users access level (or I guess you could use an array to hold / define unique users who should or shouldnt be able to to 'see' the parts)... then just write a function that reads the hidden field and based on the user who is viewing the page, show or hide the content based on the id of the web content element / part.
I would probably try to do this on the server side though before the content in question is sent to the dom.
good luck
A possible solution could be is to hide the webparts using audiences. Edit the page, edit the webpart, navigate to the properties, in the Advanced section you'll find something called "Target Audiences". Either use an existing audience (which you can create in the user profile service application) or enter a SharePoint group name (like the site members, of something alike 'managers'). Members of that group/audience will see the webpart then. Other users will not see the webpart.
Notice that this is not a security measurement. E.g. it's just preventing the rendering of the webpart, it's not preventing users from accessing the data if they know where it comes from.
Read more here: http://office.microsoft.com/en-us/sharepoint-server-help/target-content-to-specific-audiences-HA010169053.aspx

How to get the number of time a user visit a page?

Does anyone have any idea about how to get the number of time a user visit a particular site? For instance, if you do a search on google and there's a link that you clicked already, google will tell you how many times you have visited that particular link. Any ideas on how to code something like that using javascript?
Thanks.
In Google's case they can track that you have clicked on a link. Its a specific action that they can attach a javascript listener to. If you want to do the same thing on your own site, you can add some javascript that does something similar, and anytime a link is clicked an AJAX call can be made that will allow you to track that it was clicked.
However, if you are just looking to get some basic stats about pages on your site you can add Google Analytics to it, and it will gather a large amount of useful data for you.
http://www.google.com/analytics/
If you want to know how many people are visiting your page, you probably want to check out something like Google Analytics rather than making it yourself. It will give you a lot of data that you'd have to make a lot of effort to gather yourself.

Categories

Resources