Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: run STATA DO files on web?
Eric Booth <firstname.lastname@example.org>
Re: st: run STATA DO files on web?
Thu, 4 Mar 2010 10:02:40 -0600
Since you are considering an open web repository of some sort, you might try google code. It has a svn versioning system and every do-file you put there gets a short link that you can use with -do-. A couple researchers from the world bank have a Stata project there that you can explore:
and you can run any version of their do-files with the link to that version (here the version is "r81") , e.g.,
Eric A. Booth
Public Policy Research Institute
Texas A&M University
On Mar 3, 2010, at 10:13 PM, Eric Booth wrote:
> The problem is that google groups redirects your browser twice when you click the link for a file stored on google groups. If you file is located at: http://groups.google.com/group/mygroup/web/myfile.do it redirects to http://mygroup.google.groups.com/web/myfile.do because this is the way that googlegroups stores its files. Then that link redirects to a permanent location with a really long link. This last file is the only one you can directly with the -do- or -type- command, the first two files have all the html code that causes Stata to choke.
> For example, I uploaded a file called "test.do" to the google group for Stata users at http://groups.google.com/group/stata-users-forum/web/test.do
> If I simply use the link for "test.do", here's the error I get:
> do http://groups.google.com/group/stata-users-forum/web/test.do
> file http://groups.google.com/group/stata-users-forum/web/test.do not found
> server says file permanently redirected to http://stata-users-forum.googlegroups.com/web/test
> So, this gives me the redirect location.
> If I put that location into my command, it will show me all the html code that stata can't interpret...I guess you could write a program that scrubs this from the file before running it, but that seems like a pain:
> type "http://stata-users-forum.googlegroups.com/web/test.do"
> *this gives me all the html code*
> do "http://stata-users-forum.googlegroups.com/web/test.do"
> **this gives the error below because stata doesnt understand the html tags:
> . <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1
> unrecognized command: < invalid command name
> Finally, if you click on the file in google groups and reload the redirect page (or check the browser activity window if you've got a browser with developer tools), you'll see the permanent link in the address bar which you can use with -do- or -type- , and this will work.
> You could also create a shortened URL with tinyURL, etc.
> type "http://stata-users-forum.googlegroups.com/web/test.do?gda=SSPw7TkAAAAPhBKiy-Lip7KBXQRJm6l7AkTaK8g6FtbEzVxEVHzAqNf1Dl8eJvI6PhNUW9PsXbqECKgQbmraGdxlZulaYnsh"
> do "http://stata-users-forum.googlegroups.com/web/test.do?gda=SSPw7TkAAAAPhBKiy-Lip7KBXQRJm6l7AkTaK8g6FtbEzVxEVHzAqNf1Dl8eJvI6PhNUW9PsXbqECKgQbmraGdxlZulaYnsh"
> **be sure to correct the wrapping of these commands**
> ~ Eric
> Eric A. Booth
> Public Policy Research Institute
> Texas A&M University
> Office: +979.845.6754
> On Mar 3, 2010, at 9:00 PM, Kit Baum wrote:
>> I don't have any problem with Stata commands like
>> type http://fmwww.bc.edu/cfb/stata/testweb.do
>> do http://fmwww.bc.edu/cfb/stata/testweb
>> The do-file runs just fine. My web server (Apache) is configured to serve .do, .ado etc. as MIME text/plain. Perhaps on some servers (particularly Microsoft IIS) a ".do" file is served as some other MIME type which Stata does not like.
>> Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
>> An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
>> An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
* For searches and help try: