<?xml version="1.0" encoding="UTF-8" ?>
<Module>
    <ModulePrefs
        title="Concursos 2008"
        description="Novidades sobre Concursos Publicos no Brasil, apostilas, dicas, provas, simulados..."
        author="Blogolandia"
        author_affiliation="Blogolandia"
        author_location="Curitiba, PR"
        author_email="pelo@amordedeus.com"
        screenshot="http://www.concursos2008.com/conc2008_sc.jpg"
        thumbnail="http://www.concursos2008.com/conc2008_th.jpg"
        width="650"
        height="480"
        scrolling="true">
    <Require feature="opensocial-0.7" />
  </ModulePrefs>
  <UserPref name="show_date" display_name="Mostrar datas?" datatype="bool" default_value="false"/>
  <UserPref name="num_entries" display_name="Número de posts:" default_value="6"/>
  <UserPref name="show_summ" display_name="Mostrar sumários?" datatype="bool" default_value="true"/>
  <Content type="html">
  <![CDATA[

<style>
#content_div { font-size: 80%;  margin: 5px; background-color: #FFFFFF;} 
a:link, a:visited, a:active {text-decoration: none; color: #000000;}
a:hover {text-decoration: none; background:#EEEEEE; color: #FF0000;}
</style>


  <div id="content_div"></div>


  <script type="text/javascript">

  // Get userprefs
  var prefs = new gadgets.Prefs();
  var showdate = prefs.getBool("show_date");
  var entries = prefs.getInt("num_entries");
  var summaries = prefs.getBool("show_summ");

  function getFeed() {  
    var params = {};  
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;  
    params[gadgets.io.RequestParameters.NUM_ENTRIES] = new Number(entries);  
    params[gadgets.io.RequestParameters.GET_SUMMARIES] = summaries; 
    var url = "http://www.concursos2008.com/index.php/feed/";  
    gadgets.io.makeRequest(url, response, params);
  };

  function response(obj) { 
    // obj.data contains the feed data
    var feed = obj.data;
    var html = "";

    // Display the feed title and description
    html += "<div><b><font size='+2' color='#333333'><a href='http://www.concursos2008.com/' target='_blank'>" + feed.Title + "</a></font></b></div>";
    html += "<div><font size='3' color='#666666'>Aqui você encontra as últimas notícias sobre Concursos Públicos no Brasil...</font></div><br>";

    // Access the data for a given entry
    if (feed.Entry) {
      for (var i = 0; i < feed.Entry.length; i++) {
        html += "<div>"
          + "<li><a target='_blank' href='" + feed.Entry[i].Link + "'><font size='2'>"
          + feed.Entry[i].Title
          + "</font></a> ";
        if (showdate==true)
        { 
          var milliseconds = (feed.Entry[i].Date) * 1000; 
          var date = new Date(milliseconds); 
          html += date.toLocaleDateString();
          html += " ";
          html += date.toLocaleTimeString(); 
        }
        if (summaries==true) {

          summary = feed.Entry[i].Summary;
          summary = summary.replace(/(<([^>]+)>)/ig,"");
          summary = summary.substr(0,200)+"...";
          
          html += "<br><i><font size='1' color='#666666'>" + summary + "</font></i><br>";
        }
        html += "</div>";
      }
    }
    html += "<br>";
    html += "<form method='get' id='searchform_top' action='http://www.concursos2008.com/' target='_blank'>";
    html += "<font size='3'><b>Buscar Concursos:</b> </font>";
    html += "<input type='text' value='' name='s' id='searchform_top_text'>";
    html += " <input type='submit' value='procurar' id='gosearch'>";
    html += "</form>";
    document.getElementById('content_div').innerHTML = html;
  };
  gadgets.util.registerOnLoadHandler(getFeed);
  </script>


    ]]>

  </Content>
</Module>








