user code for the google program example

user code for the google program example

by Duane Mikesell -
Number of replies: 5

I am new at using the resource function in moodle v1.5.

Can I get the input for making the google example to work?

Average of ratings: -
In reply to Duane Mikesell

Re: user code for the google program example

by Tim Allen -
Hi,

Can you be more specific, there are many google tools around these days.  Which google example? 

Tim.
In reply to Tim Allen

Re: user code for the google program example

by Duane Mikesell -

The example I am refering to is the program example in the features page.

This is view.php?id=34

This example searches google with your login name

In reply to Duane Mikesell

Re: user code for the google program example

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It's a normal Resource (Web link) with some parameters like this:


Attachment google.jpg
In reply to Martin Dougiamas

Re: user code for the google program example

by Duane Mikesell -

Thanks Martin

Can I use this same approach run an exe file on my localhost?

How can I get the options for the google command line?

In reply to Duane Mikesell

Re: user code for the google program example

by Jan Dierckx -

This approach is meant to sent parameters to another application running on an webserver. This application then returns something to your browser. You can't use this approach to start regular pc programs... if that's what you mean with an exe file.

Now how do you know which parameters to send?

  1. Easiest way is to do a search for Moodle in your favorite search engine. (thus increasing Moodle's page ranking while you're at it wink)

  2. On the results page, look at the location bar of your browser. It says something like this: http://search.yahoo.com/search?p=moodle&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1&cop=&ei=UTF-8

  3. See all the a=xxxx pairs separated by the & sign?

    Take out the p=moodle& part, because that is the part we would like to automatically contain our name.

  4. Paste the resulting incomplete address in the Location: field.

  5. Add one parameter Full name to the parameter list. This will contain the name of the logged in user.

  6. Make it use p as the variable name, because that is what Yahoo uses to pass the search term.

  7. Try it!

  8. Now experiment with other search engines, other parameters (Moodle knows more than just your name), etc...