Prototyping 7 May 2013: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
 
(14 intermediate revisions by 5 users not shown)
Line 12: Line 12:
** http://bak.spc.org/iod/
** http://bak.spc.org/iod/
** [http://bak.spc.org/iod/mutation.html A means of Mutation]
** [http://bak.spc.org/iod/mutation.html A means of Mutation]


* CGI / html5lib...
* CGI / html5lib...


 
See: [[Installing Free Software with OSX]]
  * python on osx:
 
  install OSX command line tools - > https://github.com/kennethreitz/osx-gcc-installer/
  install homebrew - > http://mxcl.github.io/homebrew/


== CGI Hello Browser ==
== CGI Hello Browser ==


<source lang="python">
<source lang="python">
#!/usr/bin/python
#!/usr/bin/env python
 
#-*- coding:utf-8 -*-
import cgi, urllib2, html5lib, urlparse
import cgi, urllib2, html5lib, urlparse
import cgitb; cgitb.enable()
import cgitb; cgitb.enable()
 
print "Content-type: text/html"
print "Content-type: text/html;charset=utf-8"
print
print
 
q = cgi.FieldStorage()
q = cgi.FieldStorage()
url = q.getvalue("url","http://pzwart3.wdka.hro.nl/wiki")
url = q.getvalue("url","http://pzwart3.wdka.hro.nl/wiki")
f = urllib2.urlopen(url)
f = urllib2.urlopen(url)
t = html5lib.parse(f,treebuilder="etree",namespaceHTMLElements=False)
ct = f.info().get("content-type")
 
if ct.startswith("text/html"):
print f.info().get("content-type")
    t = html5lib.parse(f,treebuilder="etree",namespaceHTMLElements=False)
 
    for a in t.iter("a"):
for a in t.iter("a"):
        href = a.get("href")
    href = a.get("href")
        href = urlparse.urljoin(url, href)
    href = urlparse.urljoin(url, href)
        print '<a href="?url={0}">{0}</a><br>'.format(href)
    print '<a href="?url={0}">{0}</a><br>'.format(href)
</source>


#links = list(t.iter("a"))
== Ideas for browsers ==
#l = links[0]


#print f.read()
* a browser that shows or ignores content hosted in a specific country (roel)
#print "hello"
* a browser with the broken links. I will develop a browser displaying broken links.(michaela)
</source>
As I am interested in anonymous or depersonalized, transit spaces I can explore the abandoned places on the web.(start from the wiki)
* a browser that closes when you open it! (yoana)  OR a blank browser / i like to get notebooks/sketchbooks, especially i like them when they are still blank and new. I wish for a browser like that
* A browser showing the webpages by a pre-defined theme (menno)

Latest revision as of 10:33, 14 May 2013

Alternative Browsers

  • CGI / html5lib...

See: Installing Free Software with OSX

CGI Hello Browser

#!/usr/bin/env python
#-*- coding:utf-8 -*-
import cgi, urllib2, html5lib, urlparse
import cgitb; cgitb.enable()
 
print "Content-type: text/html;charset=utf-8"
print
 
q = cgi.FieldStorage()
url = q.getvalue("url","http://pzwart3.wdka.hro.nl/wiki")
f = urllib2.urlopen(url)
ct = f.info().get("content-type")
if ct.startswith("text/html"):
    t = html5lib.parse(f,treebuilder="etree",namespaceHTMLElements=False)
    for a in t.iter("a"):
        href = a.get("href")
        href = urlparse.urljoin(url, href)
        print '<a href="?url={0}">{0}</a><br>'.format(href)

Ideas for browsers

  • a browser that shows or ignores content hosted in a specific country (roel)
  • a browser with the broken links. I will develop a browser displaying broken links.(michaela)

As I am interested in anonymous or depersonalized, transit spaces I can explore the abandoned places on the web.(start from the wiki)

  • a browser that closes when you open it! (yoana) OR a blank browser / i like to get notebooks/sketchbooks, especially i like them when they are still blank and new. I wish for a browser like that
  • A browser showing the webpages by a pre-defined theme (menno)