# HG changeset patch # User Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> # Date 1303819049 -7200 # Node ID 4c3a15877f80e190ffc6fbdaf58fd4ec1272862c # Parent 2b794b7901d60f7b0d32a59397c1c7f02511a47c clean php and python scripts diff -r 2b794b7901d6 -r 4c3a15877f80 script/lib/iri_tweet/create_twitter_export_conf.py --- a/script/lib/iri_tweet/create_twitter_export_conf.py Tue Apr 26 10:53:35 2011 +0200 +++ b/script/lib/iri_tweet/create_twitter_export_conf.py Tue Apr 26 13:57:29 2011 +0200 @@ -1,5 +1,5 @@ from lxml import etree -from optparse import OptionParser +from optparse import OptionParser #@UnresolvedImport def get_options(): diff -r 2b794b7901d6 -r 4c3a15877f80 script/lib/iri_tweet/export_tweet_db.py --- a/script/lib/iri_tweet/export_tweet_db.py Tue Apr 26 10:53:35 2011 +0200 +++ b/script/lib/iri_tweet/export_tweet_db.py Tue Apr 26 13:57:29 2011 +0200 @@ -1,10 +1,9 @@ -from models import * -from utils import * -from optparse import OptionParser +from models import setup_database +from optparse import OptionParser #@UnresolvedImport from sqlalchemy.orm import sessionmaker +from utils import set_logging_options, set_logging, TwitterProcessor import logging -import sqlite3 -import sys +import sqlite3 #@UnresolvedImport # 'entities': "tweet_entity", @@ -35,11 +34,11 @@ curs_in = conn_in.cursor() fields_mapping = {} for i,res in enumerate(curs_in.execute("select json from tweet_tweet;")): - logging.debug("main loop %d : %s" % (i, res[0])) + logging.debug("main loop %d : %s" % (i, res[0])) #@UndefinedVariable processor = TwitterProcessor(eval(res[0]), res[0], session, options.token_filename) processor.process() session.commit() - logging.debug("main : %d tweet processed" % (i+1)) + logging.debug("main : %d tweet processed" % (i+1)) #@UndefinedVariable except Exception, e: session.rollback() raise e diff -r 2b794b7901d6 -r 4c3a15877f80 script/lib/iri_tweet/export_twitter_alchemy.py --- a/script/lib/iri_tweet/export_twitter_alchemy.py Tue Apr 26 10:53:35 2011 +0200 +++ b/script/lib/iri_tweet/export_twitter_alchemy.py Tue Apr 26 13:57:29 2011 +0200 @@ -2,26 +2,20 @@ # coding=utf-8 from lxml import etree -from models import * -from optparse import OptionParser -from sqlalchemy import Table, Column, Integer, BigInteger, String, MetaData, \ - ForeignKey -from sqlalchemy.orm import sessionmaker, mapper -from sqlalchemy.sql import select, or_ -from utils import * +from optparse import OptionParser #@UnresolvedImport +from sqlalchemy import Table, Column, BigInteger, MetaData +from sqlalchemy.orm import sessionmaker +from utils import parse_date, set_logging_options, set_logging, get_filter_query +from models import setup_database import datetime -import email.utils import logging -import os import os.path import re -import re import sys import time -import uuid +import uuid #@UnresolvedImport import httplib2 import anyjson -import StringIO #class TweetExclude(object): # def __init__(self, id): @@ -30,9 +24,6 @@ # def __repr__(self): # return "" % (self.id) -def parse_date(date_str): - ts = email.utils.parsedate_tz(date_str) - return datetime.datetime(*ts[0:7]) def parse_polemics(tw, extended_mode): """ @@ -108,7 +99,7 @@ set_logging(options) - logging.debug("OPTIONS : " + repr(options)) + logging.debug("OPTIONS : " + repr(options)) #@UndefinedVariable if len(sys.argv) == 1 or options.database is None: parser.print_help() @@ -164,7 +155,7 @@ for params in parameters: - logging.debug("PARAMETERS " + repr(params)) + logging.debug("PARAMETERS " + repr(params)) #@UndefinedVariable start_date_str = params.get("start_date",None) end_date_str = params.get("end_date", None) @@ -194,12 +185,12 @@ if content_file and content_file.find("http") == 0: - logging.debug("url : " + content_file) + logging.debug("url : " + content_file) #@UndefinedVariable h = httplib2.Http() resp, content = h.request(content_file) - logging.debug("url response " + repr(resp) + " content " + repr(content)) + logging.debug("url response " + repr(resp) + " content " + repr(content)) #@UndefinedVariable project = anyjson.deserialize(content) root = etree.fromstring(project["ldt"]) @@ -214,7 +205,7 @@ root = etree.Element(u"iri") - project = etree.SubElement(root, u"project", {u"abstract":u"Twitter comments on ENMI",u"title":u"Twitter comments on ENMI 2009", u"user":u"IRI Web", u"id":unicode(uuid.uuid4())}) + project = etree.SubElement(root, u"project", {u"abstract":u"Polemics Tweets",u"title":u"Polemic Tweets", u"user":u"IRI Web", u"id":unicode(uuid.uuid4())}) medias = etree.SubElement(root, u"medias") media = etree.SubElement(medias, u"media", {u"pict":u"", u"src":unicode(options.content), u"video":unicode(options.video), u"id":unicode(options.content_id), u"extra":u""}) @@ -256,7 +247,7 @@ if ensemble_parent is None: - logging.error("Can not process file") + logging.error("Can not process file") #@UndefinedVariable sys.exit() if options.replace: @@ -311,18 +302,18 @@ project["ldt"] = output_data body = anyjson.serialize(project) - logging.debug("write http " + content_file) - logging.debug("write http " + repr(body)) + logging.debug("write http " + content_file) #@UndefinedVariable + logging.debug("write http " + repr(body)) #@UndefinedVariable h = httplib2.Http() resp, content = h.request(content_file, "PUT", headers={'content-type':'application/json'}, body=body) - logging.debug("write http " + repr(resp) + " content " + content) + logging.debug("write http " + repr(resp) + " content " + content) #@UndefinedVariable else: if content_file and os.path.exists(content_file): dest_file_name = content_file else: dest_file_name = options.filename - logging.debug("WRITE : " + dest_file_name) + logging.debug("WRITE : " + dest_file_name) #@UndefinedVariable output = open(dest_file_name, "w") output.write(output_data) output.flush() diff -r 2b794b7901d6 -r 4c3a15877f80 script/lib/iri_tweet/models.py --- a/script/lib/iri_tweet/models.py Tue Apr 26 10:53:35 2011 +0200 +++ b/script/lib/iri_tweet/models.py Tue Apr 26 13:57:29 2011 +0200 @@ -67,6 +67,7 @@ user_id = Column(Integer, ForeignKey('tweet_user.id')) original_json = Column(String) entity_list = relationship(Entity, backref='tweet') + received_at = Column(DateTime, default=datetime.datetime.now()) #user = relationship(User, primaryjoin=user_id == User.id) diff -r 2b794b7901d6 -r 4c3a15877f80 script/lib/iri_tweet/utils.py --- a/script/lib/iri_tweet/utils.py Tue Apr 26 10:53:35 2011 +0200 +++ b/script/lib/iri_tweet/utils.py Tue Apr 26 13:57:29 2011 +0200 @@ -260,7 +260,7 @@ #user user_fields = { - 'lang' : self.json_dict['iso_language_code'], + 'lang' : self.json_dict.get('iso_language_code',None), 'profile_image_url' : self.json_dict["profile_image_url"], 'screen_name' : self.json_dict["from_user"], } diff -r 2b794b7901d6 -r 4c3a15877f80 script/rest/search_enmi.py --- a/script/rest/search_enmi.py Tue Apr 26 10:53:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -from iri_tweet import models, utils -from sqlalchemy.orm import sessionmaker -import anyjson -import sqlite3 -import twitter - -def get_option(): - - parser = OptionParser() - - parser.add_option("-l", "--log", dest="logfile", - help="log to file", metavar="LOG", default="stderr") - parser.add_option("-v", dest="verbose", action="count", - help="verbose", metavar="VERBOSE", default=0) - parser.add_option("-q", dest="quiet", action="count", - help="quiet", metavar="QUIET", default=0) - parser.add_option("-r", "--request", dest="request", - help="twitter request", metavar="REQUEST", default=0) - parser.add_option("-Q", dest="query", - help="query", metavar="QUERY") - parser.add_option("-P", dest="rpp", metavar="RPP", default="50", - help="Result per page") - parser.add_option("-t", dest="token_filename", metavar="TOKEN_FILENAME", default=".oauth_token", - help="Token file name") - - - #add request token - #add - - return parser.parse_args() - -if __name__ == "__main__": - - (options, args) = get_option() - - twitter = twitter.Twitter(domain="search.twitter.com") - engine, metadata = models.setup_database('sqlite:///'+args[0], echo=((options.verbose-options.quiet)>0)) - Session = sessionmaker(bind=engine) - session = Session() - try: - #conn.row_factory = sqlite3.Row - #curs = conn.cursor() - #curs.execute("create table if not exists tweet_tweet (json);") - #conn.commit() - - results = None - page = 1 - - while page <= int(1500/int(options.rpp)) and ( results is None or len(results) > 0): - results = twitter. search(q=options.query, rpp=options.rpp, page=page) - for tweet in results["results"]: - print tweet - tweet_str = anyjson.serialize(tweet) - #invalidate user id - processor = utils.TwitterProcessor(tweet, tweet_str, session, options.token_filename) - processor.process() - session.flush() - page += 1 - session.commit() - finally: - session.close() - - diff -r 2b794b7901d6 -r 4c3a15877f80 script/rest/search_twitter.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script/rest/search_twitter.py Tue Apr 26 13:57:29 2011 +0200 @@ -0,0 +1,66 @@ +from iri_tweet import models, utils +from sqlalchemy.orm import sessionmaker +import anyjson +import sqlite3 +import twitter +from optparse import OptionParser + + +def get_option(): + + parser = OptionParser() + + parser.add_option("-l", "--log", dest="logfile", + help="log to file", metavar="LOG", default="stderr") + parser.add_option("-v", dest="verbose", action="count", + help="verbose", metavar="VERBOSE", default=0) + parser.add_option("-q", dest="quiet", action="count", + help="quiet", metavar="QUIET", default=0) + parser.add_option("-r", "--request", dest="request", + help="twitter request", metavar="REQUEST", default=0) + parser.add_option("-Q", dest="query", + help="query", metavar="QUERY") + parser.add_option("-P", dest="rpp", metavar="RPP", default="50", + help="Result per page") + parser.add_option("-t", dest="token_filename", metavar="TOKEN_FILENAME", default=".oauth_token", + help="Token file name") + + + #add request token + #add + + return parser.parse_args() + +if __name__ == "__main__": + + (options, args) = get_option() + + twitter = twitter.Twitter(domain="search.twitter.com") + engine, metadata = models.setup_database('sqlite:///'+args[0], echo=((options.verbose-options.quiet)>0)) + Session = sessionmaker(bind=engine) + session = Session() + try: + #conn.row_factory = sqlite3.Row + #curs = conn.cursor() + #curs.execute("create table if not exists tweet_tweet (json);") + #conn.commit() + + results = None + page = 1 + + while page <= int(1500/int(options.rpp)) and ( results is None or len(results) > 0): + results = twitter. search(q=options.query, rpp=options.rpp, page=page) + for tweet in results["results"]: + print tweet + tweet_str = anyjson.serialize(tweet) + #invalidate user id + processor = utils.TwitterProcessor(tweet, tweet_str, session, options.token_filename) + processor.process() + session.flush() + session.commit() + page += 1 + #session.commit() + finally: + session.close() + + diff -r 2b794b7901d6 -r 4c3a15877f80 script/stream/get_stats.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script/stream/get_stats.py Tue Apr 26 13:57:29 2011 +0200 @@ -0,0 +1,38 @@ + +import httplib2 +import anyjson +from lxml import etree +import sys +import pprint + +def get_stats(url): + + h = httplib2.Http() + resp, content = h.request(url) + #project = anyjson.deserialize(content) + root = etree.fromstring(content) + + #get all annotations + res_xpath = root.xpath("//ensemble[starts-with(@id,'tweet_')]//element") + + total_annot = len(res_xpath) + total_with_polemic = 0 + total_by_type = {} + + + for annot in res_xpath: + polemic_list = annot.xpath("meta/polemics/polemic") + if len(polemic_list)> 0: + total_with_polemic += 1 + for polemic_item in polemic_list: + pol_type = polemic_item.text + total_by_type[pol_type] = total_by_type.get(pol_type,0) + 1 + + + return {"total_annotations": total_annot, "total_with_polemics": total_with_polemic, "polemic_by_type": total_by_type} + +if __name__ == "__main__": + + pp = pprint.PrettyPrinter(indent=4, width=1) + + pp.pprint(get_stats(sys.argv[1])) \ No newline at end of file diff -r 2b794b7901d6 -r 4c3a15877f80 web/.htaccess --- a/web/.htaccess Tue Apr 26 10:53:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -php_value include_path ".:/Users/cybunk/WORK/IRI/REPO_TWEET_LIVE/web/lib/" \ No newline at end of file diff -r 2b794b7901d6 -r 4c3a15877f80 web/.htaccess.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/.htaccess.tmpl Tue Apr 26 13:57:29 2011 +0200 @@ -0,0 +1,1 @@ +php_value include_path ".:/Users/cybunk/WORK/IRI/REPO_TWEET_LIVE/web/lib/" \ No newline at end of file diff -r 2b794b7901d6 -r 4c3a15877f80 web/about.php --- a/web/about.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/about.php Tue Apr 26 13:57:29 2011 +0200 @@ -21,8 +21,8 @@ - - + + @@ -53,16 +53,6 @@ //$(this).css({'backgroundColor':'#f6f6f6'}); $(this).css({'backgroundColor':'#f2f2f2'}); }); - - - $(".slidetabs").tabs(".images > div", { - effect: 'fade', - rotate: false, - interval: 4000, - clickable:false - }).slideshow(); - - $(".slidetabs").data("slideshow").play(); }); diff -r 2b794b7901d6 -r 4c3a15877f80 web/client.php --- a/web/client.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/client.php Tue Apr 26 13:57:29 2011 +0200 @@ -57,7 +57,7 @@ - + diff -r 2b794b7901d6 -r 4c3a15877f80 web/custom.css --- a/web/custom.css Tue Apr 26 10:53:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* ----------------------------------------------------------------------- - - - IRI - Live tweet annotation CSS - http://www.iri.centrepompidou.fr - - * Copyright (c) 2010-Present. See LICENSE for more info. (cecill-C) - * Contributor : Samuel Huron - ------------------------------------------------------------------------ */ - -body {background-image:url(images/bgd.jpg);background-repeat:repeat-x;background-color:#f7f6f6;font-family: 'PT Sans', arial, serif; } -textarea {margin-left:3px;height: 60px;width: 330px;padding:5px;background-image:url(images/tweetWriterBgdTxtArea.gif);background-repeat:no-repeat;border: none;} -.loginbutton{margin-left:3px;height: 60px;width: 330px;padding:5px;background-image:url(images/tweetWriterBgdUnconnect.gif);background-repeat:no-repeat;border: none;margin-bottom:10px;color:#fff;} -.loginlink{text-decoration:none;color:#fff;} -.menuLink:active {text-decoration:none;} -.menuLink:visited {text-decoration:none;} -h3{font-size: 1.5em;line-height: 1;margin-bottom: 0.3em;} - -#Aboutbox{background-image:url(images/about_bgd.jpg);background-repeat:no-repeat;width:600px;height:360px;overflow:auto; border:1px solid #fff;} -.lightBorder{padding:20px;} -.lightTitle{font-size: 48px;font-weight:900;color:#e6e6e6;font-family: 'Geo', arial, serif;line-height:80%} -.lightSubTitle{font-size: 24px;font-weight:bold;color:#262626; width:250px;line-height:80%} -.lightDescription{font-size: 12px;color:#000; width:288px;text-align:justify;margin-top:15px;} -.lightButton{width:134px;height:22px;background-image:url(images/bt_bgd_grey.jpg);background-repeat:no-repeat;} -.lightButton:active{width:134px;height:22px;background-image:url(images/bt_bgd_grey.jpg);background-repeat:no-repeat;} -.lightButton:over{text-decoration:none;background-image:url(images/bt_bgd_grey.jpg);background-repeat:no-repeat;} - - -.logo{padding-right:10px;float:left;} -.menu{float:left;height:62px;border-left:1px solid #c3c3c3;list-style-type:none;padding:0px;margin:0px;} -.menuUnderline{margin-left:0px;padding-left:0px;background-image:url(images/menu_underline.gif);background-repeat:no-repeat;background-position:left bottom; width:100px;margin-top:3px;} -.menuLink{text-decoration:none; margin:5px; color:#000} -.menuLink:active {text-decoration:none;} -.menuLink:visited {text-decoration:none;} -.lang{margin-left:500px;} - -.tweetContainer{position:absolute; margin-top:70px;} -.tweetWriter{background-image:url(images/tweetWriterBgd.gif);width:359px;height:136px;padding:10px;position:absolute; margin-top:70px;} -.tweetWriterTitle{color:4b4b4b;font-family: 'PT Sans Narrow', arial, serif;} -.tweetExplain{background-image:url(images/tweetExplainBgd.gif);width:359px;height:510px;padding:10px;position:absolute; margin-top:70px;} - -.tweetReader{width:377px;height:450px;position:absolute; margin-top:225px;border:1px solid #c3c3c3;background:#ffffff;} -.tweetButton{float:right;margin-right:5px;} - -.timelinePlayer{border:1px solid #c3c3c3;width:650px;height:650px;} -.videoLivePlayer{border:1px solid #c3c3c3;width:500px;height:375px;} -.videoLive{width:500px;height:378px;background:#fff;float:left;margin-top:20px;padding:5px;} -.videoLiveProgram{width:500px;margin-top:425px;margin-left:392px;position:absolute;} -.videoLiveProgram2{width:500px;margin-top:470px;margin-left:392px;position:absolute;} - -.videoLiveProgramTitle{color:#4b4b4b;font-family: 'PT Sans Narrow', arial, serif;font-size: 1.5em;padding:5px;border:1px solid #c3c3c3;background-color:#efefef;background-image:url(images/bgdTitle.jpg);background-repeat:no-repeat;} -.videoLiveProgramDescription{padding:5px;border:1px solid #c3c3c3;padding:5px;border-top:none;background-color:#fff;background-image:url(images/bgdDescription.jpg);background-repeat:no-repeat;height:193px;overflow:scroll;} - - -.footer{margin-top:770px;width:900px;height:20px;position:absolute;text-align:center;} -.footerLink{text-decoration:none; margin:5px; color:#000;font-family: 'PT Sans Narrow', arial, serif;font-size: 1.1em;} -.footerLink:active {text-decoration:none;} -.footerLink:visited {text-decoration:none;} - -.tooltip {display:none;background:transparent url(images/white_arrow.png);font-size:12px;height:70px;width:160px;padding:25px;color:#000;} - -.timeline{height:28px;border: 1px solid #ccc;} -.timeFragment {float:left;position:relative;float:left;} -.timeFrame {border-left: 1px solid #AAA;border-right: 1px solid #AAA;height:10px;float:left;position:relative;} -.bigTimeFrame {border-right: 1px solid #ccc;float:left;position:relative;} - -.arrowContainer{height:10px;width:100%;} - -.cleaner {clear:both;} -.txt{visibility:hidden;} - - -.clear { /* generic container (i.e. div) for floating buttons */ - overflow: hidden; - width: 100%; -} - -a.button_w { background: transparent url('images/bg_button_a_w.png') no-repeat scroll top right; color: #444;display: block;float: left;font: normal 12px arial, sans-serif;height: 24px;margin-right: 6px;padding-right: 18px; text-decoration: none;} -a.button_w span { background: transparent url('images/bg_button_span_w.png') no-repeat; display: block;line-height: 14px; padding: 5px 0 5px 18px;} - -a.button_b { background: transparent url('images/bg_button_a_b.png') no-repeat scroll top right; color: #fff;display: block;float: left;font: bold 12px arial, sans-serif;height: 24px;margin-right: 6px;padding-right: 18px; text-decoration: none;} -a.button_b span { background: transparent url('images/bg_button_span_b.png') no-repeat; display: block;line-height: 14px; padding: 5px 0 5px 18px;} - -#question{background: transparent url('images/bt_blue.png') no-repeat; width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } -#question:active {text-decoration:none;} -#question:visited {text-decoration:none;} -#reference{background: transparent url('images/bt_yellow.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } -#reference:active {text-decoration:none;} -#reference:visited {text-decoration:none;} -#positive{background: transparent url('images/bt_green.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } -#positive:active {text-decoration:none;} -#positive:visited {text-decoration:none;} -#negative{background: transparent url('images/bt_red.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } -#negative:active {text-decoration:none;} -#negative:visited {text-decoration:none;} - -.introBox{width:880px;height:280px;padding:10px;position:absolute; margin-top:70px;} -.aboutBox{background-image:url(images/archivesBoxBody.gif);width:900px;position:absolute; margin-top:70px;} -.archivesBox{background-image:url(images/archivesBoxBody.gif);width:900px;position:absolute; margin-top:450px;} -.archivesBoxContainer{padding:10px;width:880px;padding-bottom:0px;display:block; } -.archivesBoxClear { /* generic container (i.e. div) for floating buttons */ - overflow: hidden; - width: 100%; - background-image:url(images/archivesBoxBody.gif); - height:10px; -} -.archivesBoxFooter{background-repeat:no-repeat;background-position:left bottom;background-image:url(images/archivesBoxFooter.gif);width:100%;height:3px;} -.archivesBoxHeader{background-repeat:no-repeat;background-position:left top;background-image:url(images/archivesBoxHeader.gif);width:100%;height:3px;} - -.archivesTitle{color:4b4b4b;font-family: 'PT Sans Narrow', arial, serif;font-size:24px;} -.archivesVideoBox{margin:5px;padding:5px;position:relative;display:inline-block;float:left;border: solid 1px #ccc;background:#f2f2f2;cursor:pointer;} -.AVBtitle{font-weight:bold;font-family: 'PT Sans Narrow', arial, serif; font-size:18px;} - -.slideTitle{font-size:20px;} -.slideText{font-size:15px;} -.slides{background-repeat:no-repeat;background-position:right top;} -#minilogo{background-repeat:no-repeat;background-position:left top;background-image:url(images/pol_color.gif);width:46px;height:10px;margin-top:50px;z-index:9;position:absolute;margin-left:100px;}} \ No newline at end of file diff -r 2b794b7901d6 -r 4c3a15877f80 web/enmi/index.php --- a/web/enmi/index.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/enmi/index.php Tue Apr 26 13:57:29 2011 +0200 @@ -41,7 +41,7 @@ - + diff -r 2b794b7901d6 -r 4c3a15877f80 web/images/Logo-thdculture.png Binary file web/images/Logo-thdculture.png has changed diff -r 2b794b7901d6 -r 4c3a15877f80 web/images/flag_en.gif Binary file web/images/flag_en.gif has changed diff -r 2b794b7901d6 -r 4c3a15877f80 web/images/flag_fr.gif Binary file web/images/flag_fr.gif has changed diff -r 2b794b7901d6 -r 4c3a15877f80 web/images/flag_jp.gif Binary file web/images/flag_jp.gif has changed diff -r 2b794b7901d6 -r 4c3a15877f80 web/index.php --- a/web/index.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/index.php Tue Apr 26 13:57:29 2011 +0200 @@ -40,8 +40,8 @@ - - + + diff -r 2b794b7901d6 -r 4c3a15877f80 web/res/css/custom.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/css/custom.css Tue Apr 26 13:57:29 2011 +0200 @@ -0,0 +1,118 @@ +/* ----------------------------------------------------------------------- + + + IRI - Live tweet annotation CSS + http://www.iri.centrepompidou.fr + + * Copyright (c) 2010-Present. See LICENSE for more info. (cecill-C) + * Contributor : Samuel Huron + +----------------------------------------------------------------------- */ + +body {background-image:url(../../images/bgd.jpg);background-repeat:repeat-x;background-color:#f7f6f6;font-family: 'PT Sans', arial, serif; } +textarea {margin-left:3px;height: 60px;width: 330px;padding:5px;background-image:url(../../images/tweetWriterBgdTxtArea.gif);background-repeat:no-repeat;border: none;} +.loginbutton{margin-left:3px;height: 60px;width: 330px;padding:5px;background-image:url(../../images/tweetWriterBgdUnconnect.gif);background-repeat:no-repeat;border: none;margin-bottom:10px;color:#fff;} +.loginlink{text-decoration:none;color:#fff;} +.menuLink:active {text-decoration:none;} +.menuLink:visited {text-decoration:none;} +h3{font-size: 1.5em;line-height: 1;margin-bottom: 0.3em;} + +#Aboutbox{background-image:url(../../images/about_bgd.jpg);background-repeat:no-repeat;width:600px;height:360px;overflow:auto; border:1px solid #fff;} +.lightBorder{padding:20px;} +.lightTitle{font-size: 48px;font-weight:900;color:#e6e6e6;font-family: 'Geo', arial, serif;line-height:80%} +.lightSubTitle{font-size: 24px;font-weight:bold;color:#262626; width:250px;line-height:80%} +.lightDescription{font-size: 12px;color:#000; width:288px;text-align:justify;margin-top:15px;} +.lightButton{width:134px;height:22px;background-image:url(../../images/bt_bgd_grey.jpg);background-repeat:no-repeat;} +.lightButton:active{width:134px;height:22px;background-image:url(../../images/bt_bgd_grey.jpg);background-repeat:no-repeat;} +.lightButton:over{text-decoration:none;background-image:url(../../images/bt_bgd_grey.jpg);background-repeat:no-repeat;} + + +.logo{padding-right:10px;float:left;} +.menu{float:left;height:62px;border-left:1px solid #c3c3c3;list-style-type:none;padding:0px;margin:0px;} +.menuUnderline{margin-left:0px;padding-left:0px;background-image:url(../../images/menu_underline.gif);background-repeat:no-repeat;background-position:left bottom; width:100px;margin-top:3px;} +.menuLink{text-decoration:none; margin:5px; color:#000} +.menuLink:active {text-decoration:none;} +.menuLink:visited {text-decoration:none;} +.lang{margin-left:500px;} + +.tweetContainer{position:absolute; margin-top:70px;} +.tweetWriter{background-image:url(../../images/tweetWriterBgd.gif);width:359px;height:136px;padding:10px;position:absolute; margin-top:70px;} +.tweetWriterTitle{color:4b4b4b;font-family: 'PT Sans Narrow', arial, serif;} +.tweetExplain{background-image:url(../../images/tweetExplainBgd.gif);width:359px;height:510px;padding:10px;position:absolute; margin-top:70px;} + +.tweetReader{width:377px;height:450px;position:absolute; margin-top:225px;border:1px solid #c3c3c3;background:#ffffff;} +.tweetButton{float:right;margin-right:5px;} + +.timelinePlayer{border:1px solid #c3c3c3;width:650px;height:650px;} +.videoLivePlayer{border:1px solid #c3c3c3;width:500px;height:375px;} +.videoLive{width:500px;height:378px;background:#fff;float:left;margin-top:20px;padding:5px;} +.videoLiveProgram{width:500px;margin-top:425px;margin-left:392px;position:absolute;} +.videoLiveProgram2{width:500px;margin-top:470px;margin-left:392px;position:absolute;} + +.videoLiveProgramTitle{color:#4b4b4b;font-family: 'PT Sans Narrow', arial, serif;font-size: 1.5em;padding:5px;border:1px solid #c3c3c3;background-color:#efefef;background-image:url(../../images/bgdTitle.jpg);background-repeat:no-repeat;} +.videoLiveProgramDescription{padding:5px;border:1px solid #c3c3c3;padding:5px;border-top:none;background-color:#fff;background-image:url(../../images/bgdDescription.jpg);background-repeat:no-repeat;height:193px;overflow:scroll;} + + +.footer{margin-top:770px;width:900px;height:20px;position:absolute;text-align:center;} +.footerLink{text-decoration:none; margin:5px; color:#000;font-family: 'PT Sans Narrow', arial, serif;font-size: 1.1em;} +.footerLink:active {text-decoration:none;} +.footerLink:visited {text-decoration:none;} + +.tooltip {display:none;background:transparent url(../../images/white_arrow.png);font-size:12px;height:70px;width:160px;padding:25px;color:#000;} + +.timeline{height:28px;border: 1px solid #ccc;} +.timeFragment {float:left;position:relative;float:left;} +.timeFrame {border-left: 1px solid #AAA;border-right: 1px solid #AAA;height:10px;float:left;position:relative;} +.bigTimeFrame {border-right: 1px solid #ccc;float:left;position:relative;} + +.arrowContainer{height:10px;width:100%;} + +.cleaner {clear:both;} +.txt{visibility:hidden;} + + +.clear { /* generic container (i.e. div) for floating buttons */ + overflow: hidden; + width: 100%; +} + +a.button_w { background: transparent url('../../images/bg_button_a_w.png') no-repeat scroll top right; color: #444;display: block;float: left;font: normal 12px arial, sans-serif;height: 24px;margin-right: 6px;padding-right: 18px; text-decoration: none;} +a.button_w span { background: transparent url('../../images/bg_button_span_w.png') no-repeat; display: block;line-height: 14px; padding: 5px 0 5px 18px;} + +a.button_b { background: transparent url('../../images/bg_button_a_b.png') no-repeat scroll top right; color: #fff;display: block;float: left;font: bold 12px arial, sans-serif;height: 24px;margin-right: 6px;padding-right: 18px; text-decoration: none;} +a.button_b span { background: transparent url('../../images/bg_button_span_b.png') no-repeat; display: block;line-height: 14px; padding: 5px 0 5px 18px;} + +#question{background: transparent url('../../images/bt_blue.png') no-repeat; width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } +#question:active {text-decoration:none;} +#question:visited {text-decoration:none;} +#reference{background: transparent url('../../images/bt_yellow.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } +#reference:active {text-decoration:none;} +#reference:visited {text-decoration:none;} +#positive{background: transparent url('../../images/bt_green.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } +#positive:active {text-decoration:none;} +#positive:visited {text-decoration:none;} +#negative{background: transparent url('../../images/bt_red.png') no-repeat;width:32px;height:20px;text-decoration: none;font: normal 12px;color: #444;text-align:center; } +#negative:active {text-decoration:none;} +#negative:visited {text-decoration:none;} + +.introBox{width:880px;height:280px;padding:10px;position:absolute; margin-top:70px;} +.aboutBox{background-image:url(../../images/archivesBoxBody.gif);width:900px;position:absolute; margin-top:70px;} +.archivesBox{background-image:url(../../images/archivesBoxBody.gif);width:900px;position:absolute; margin-top:450px;} +.archivesBoxContainer{padding:10px;width:880px;padding-bottom:0px;display:block; } +.archivesBoxClear { /* generic container (i.e. div) for floating buttons */ + overflow: hidden; + width: 100%; + background-image:url(../../images/archivesBoxBody.gif); + height:10px; +} +.archivesBoxFooter{background-repeat:no-repeat;background-position:left bottom;background-image:url(../../images/archivesBoxFooter.gif);width:100%;height:3px;} +.archivesBoxHeader{background-repeat:no-repeat;background-position:left top;background-image:url(../../images/archivesBoxHeader.gif);width:100%;height:3px;} + +.archivesTitle{color:4b4b4b;font-family: 'PT Sans Narrow', arial, serif;font-size:24px;} +.archivesVideoBox{margin:5px;padding:5px;position:relative;display:inline-block;float:left;border: solid 1px #ccc;background:#f2f2f2;cursor:pointer;} +.AVBtitle{font-weight:bold;font-family: 'PT Sans Narrow', arial, serif; font-size:18px;} + +.slideTitle{font-size:20px;} +.slideText{font-size:15px;} +.slides{background-repeat:no-repeat;background-position:right top;} +#minilogo{background-repeat:no-repeat;background-position:left top;background-image:url(../../images/pol_color.gif);width:46px;height:10px;margin-top:50px;z-index:9;position:absolute;margin-left:100px;}} \ No newline at end of file diff -r 2b794b7901d6 -r 4c3a15877f80 web/res/css/tabs-slideshow.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/css/tabs-slideshow.css Tue Apr 26 13:57:29 2011 +0200 @@ -0,0 +1,96 @@ + +/* container for slides */ +.images { + /*background:#fff url(images/h300.png) repeat-x;*/ + background:#fff; + border:1px solid #ccc; + position:relative; + height:300px; + + width:860px; + float:left; + margin:15px; + cursor:pointer; + + /* CSS3 tweaks for modern browsers */ + -moz-border-radius:5px; + -webkit-border-radius:5px; + -moz-box-shadow:0 0 25px #666; + -webkit-box-shadow:0 0 25px #666; +} + +/* single slide */ +.images div { + display:none; + position:absolute; + top:0; + left:0; + margin:7px; + padding:15px 30px 15px 15px; + height:256px; + font-size:12px; +} + +/* header */ +.images h3 { + font-size:22px; + font-weight:normal; + margin:0 0 20px 0; + color:#456; +} + +/* tabs (those little circles below slides) */ +.slidetabs { + clear:both; + margin-left:430px; +} + +/* single tab */ +.slidetabs a { + width:8px; + height:8px; + float:left; + margin:3px; + background:url(../../images/navigator.png) 0 0 no-repeat; + display:block; + font-size:1px; +} + +/* mouseover state */ +.slidetabs a:hover { + background-position:0 -8px; +} + +/* active state (current page state) */ +.slidetabs a.current { + background-position:0 -16px; +} + + +/* prev and next buttons */ +.forward, .backward { + float:left; + margin-top:140px; + background:#fff /*url(/tools/img/scrollable/arrow/hori_large.png)*/ no-repeat; + display:block; + width:30px; + height:30px; + cursor:pointer; + font-size:1px; + text-indent:-9999em; +} + +/* next */ +.forward { background-position: 0 -30px; clear:right; } +.forward:hover { background-position:-30px -30px; } +.forward:active { background-position:-60px -30px; } + + +/* prev */ +.backward:hover { background-position:-30px 0; } +.backward:active { background-position:-60px 0; } + +/* disabled navigational button. is not needed when tabs are configured with rotate: true */ +.disabled { + visibility:hidden !important; +} diff -r 2b794b7901d6 -r 4c3a15877f80 web/res/metadataplayer.polemic/src/js/polemic.js --- a/web/res/metadataplayer.polemic/src/js/polemic.js Tue Apr 26 10:53:35 2011 +0200 +++ b/web/res/metadataplayer.polemic/src/js/polemic.js Tue Apr 26 13:57:29 2011 +0200 @@ -62,11 +62,11 @@ // ou Frame vide }; Frames.prototype.draw = function(){ - } + }; Frames.prototype.zoom = function(){ - } + }; Frames.prototype.inside = function(){ - } + }; var Clusters = function(){ var Object; var yDist; @@ -79,7 +79,7 @@ // make my object }; var Tweet = function(){ - } + }; // Classes ======================================================================= // trace function @@ -130,7 +130,7 @@ yframe:Myframe, title:item.content['title'], timeframe:item.begin - } + }; numberOfTweet+=1; } }else{ @@ -142,7 +142,7 @@ yframe:Myframe, title:item.content['title'], timeframe:item.begin - } + }; numberOfTweet+=1; } @@ -198,7 +198,7 @@ for (var j=0; j<6; j++){ if (frames[i]!=undefined){ if (frames[i].qualifVol[j]!=undefined){ - moy += frames[i].qualifVol[j] + moy += frames[i].qualifVol[j]; } } } @@ -235,12 +235,12 @@ }).mouseout(function () { //this.attr({stroke:"#00","stroke-width":0.1}); }).mousedown(function () { - __IriSP.MyApiPlayer.seek(this.time/1000) + __IriSP.MyApiPlayer.seek(this.time/1000); }); __IriSP.jQuery(e.node).attr('id', 't'+k+''); __IriSP.jQuery(e.node).attr('title', frames[i].mytweetsID[k].title); __IriSP.jQuery(e.node).attr('begin', frames[i].mytweetsID[k].timeframe); - var tempPosition = {x:i*frameSize,y:config.heightmax-addEheight} + var tempPosition = {x:i*frameSize,y:config.heightmax-addEheight}; addTip(e.node, frames[i].mytweetsID[k].title,colors[j],tempPosition); //frames[i].mytweetsID.pop(); } @@ -262,14 +262,17 @@ PaperSlider.toFront(); PaperBackground.toBack(); } - PaperSlider.toFront(); + + if(typeof(PaperSlider) !== 'undefined' ) { + PaperSlider.toFront(); + } } $(document).mousemove(function(e){ if (over){ __IriSP.jQuery("#tip").css("left", e.pageX-106).css("top", e.pageY-160); - __IriSP.jQuery("#tipcolor").css("background-color", tipColor) + __IriSP.jQuery("#tipcolor").css("background-color", tipColor); __IriSP.jQuery("#tiptext").text(tipText); __IriSP.jQuery("#tip").show(); }else{ diff -r 2b794b7901d6 -r 4c3a15877f80 web/rsln-opendata/embed_form.php --- a/web/rsln-opendata/embed_form.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/rsln-opendata/embed_form.php Tue Apr 26 13:57:29 2011 +0200 @@ -19,7 +19,7 @@ - + diff -r 2b794b7901d6 -r 4c3a15877f80 web/rsln-opendata/polemicaltimeline.old.php --- a/web/rsln-opendata/polemicaltimeline.old.php Tue Apr 26 10:53:35 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ - - - - - RSLN - Live Video and Annotation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - - -
- - - - - - - - - - - - -
-

Annotations polémique :


- l’Institut de recherche et d’innovation (Iri) vous a proposé une expérimentation et une démonstration d’un dispositif d’annotation polémique basé sur twitter. -Cette qualification de vos tweets nous a permis de créer une timeline polemique représentant les positions de -l'auditoire durant la conférence. -

- - Cette syntaxe polémique vous a premis de prendre position relativement à l’intervenant ou aux autres participants au débat : - - - - - - - - - - - - - -
- ++ correspond à un tweet d’assentiment
- - -- à un tweet de désaccord,
- == à un tweet de référence
- ?? à une question
- - Suite a cette phase d’annotation, vous trouverez à droite de ce texte la version alpha de l'interface de navigation et de représentation de la polémique durant la conférence. - -

-Ce dispositif, outre qu’il approfondit la dimension critique de la discussion avec la salle et les auditeurs présents ou distants, permet ainsi également de pérenniser et de valoriser les commentaires produits en les rendant accessibles en temps différé lors de tout visionnage ultérieur de la vidéo  -
-
Merci a RSLN pour cette expérimentation ! -
- - - - - -
-
- -
- - - - -
- - - -
- -
- - - - - - - -
- - - - - - - diff -r 2b794b7901d6 -r 4c3a15877f80 web/rsln-opendata/polemicaltimeline.php --- a/web/rsln-opendata/polemicaltimeline.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/rsln-opendata/polemicaltimeline.php Tue Apr 26 13:57:29 2011 +0200 @@ -5,7 +5,7 @@ * People still do this? ;) */ // configuration -include $_SERVER['DOCUMENT_ROOT'].'/common.php'; +include 'common.php'; // objet actuel include_once 'config.php'; @@ -31,7 +31,7 @@ - + @@ -44,7 +44,7 @@ .videoLivePlayer{border:1px solid #c3c3c3;width:650px;height:638px;} .videoLive{width:650px;height:640px;background:#fff;float:right;margin-top:20px;padding:5px;} - .tweetExplain{background-image:url(images/tweetExplainBgd.gif);width:250px;height:640px;padding:10px;position:absolute; margin-top:70px;} + .tweetExplain{background-image:url(../images/tweetExplainBgd.gif);width:250px;height:640px;padding:10px;position:absolute; margin-top:70px;} .footer{margin-top:740px;width:960px;height:20px;position:absolute;text-align:center;} .tooltip{ z-index: 10000000000; @@ -132,7 +132,7 @@
- + -
diff -r 2b794b7901d6 -r 4c3a15877f80 web/rsln/embed_form.php --- a/web/rsln/embed_form.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/rsln/embed_form.php Tue Apr 26 13:57:29 2011 +0200 @@ -19,7 +19,7 @@ - + diff -r 2b794b7901d6 -r 4c3a15877f80 web/rsln/polemicaltimeline.php --- a/web/rsln/polemicaltimeline.php Tue Apr 26 10:53:35 2011 +0200 +++ b/web/rsln/polemicaltimeline.php Tue Apr 26 13:57:29 2011 +0200 @@ -5,7 +5,7 @@ * People still do this? ;) */ // configuration -include $_SERVER['DOCUMENT_ROOT'].'/common.php'; +include 'common.php'; // objet actuel include_once 'config.php'; @@ -31,7 +31,7 @@ - + @@ -44,7 +44,7 @@ .videoLivePlayer{border:1px solid #c3c3c3;width:650px;height:638px;} .videoLive{width:650px;height:640px;background:#fff;float:right;margin-top:20px;padding:5px;} - .tweetExplain{background-image:url(images/tweetExplainBgd.gif);width:250px;height:640px;padding:10px;position:absolute; margin-top:70px;} + .tweetExplain{background-image:url(../images/tweetExplainBgd.gif);width:250px;height:640px;padding:10px;position:absolute; margin-top:70px;} .footer{margin-top:740px;width:960px;height:20px;position:absolute;text-align:center;} .tooltip{ z-index: 10000000000; @@ -132,7 +132,7 @@
- + -