Report abuse

#!/bin/sh

#cat bor-2007-03-29 | sed -e '/[0-9][0-9]:[0-9][0-9] \/\//d;/[0-9][0-9]:[0-9][0-9]   \*/d;/[0-9][0-9]:[0-9][0-9] \/\*\*/d;/[0-9][0-9]:[0-9][0-9] this\./d' | sed -e '/[0-9][0-9]:[0-9][0-9] cutty/d' | sed -e '/\([0-9][0-9]:[0-9][0-9] \([^ \t]*\) [a-z]:\)\|\([^~]http\)\|\([0-9][0-9]:[0-9][0-9] \([^ \t]\) [0-9]+:\)/!d'                                    
# 
#cat all_logs | \
# sed -e '/bordom\.net/d' | \
# sed -e "s/bor-2007-\([0-9][0-9]-[0-9][0-9]\) \([0-9][0-9]:[0-9][0-9]\) \([^ \t]\+\) .*http\([^ \t]\+\)/INSERT INTO items (url,title,author,source,mimetype,time,updated,queued,public) VALUES (\"http\4\", ftitlef, \"\3\", \"#bor\", fmimetypef, \"\1\2\", \"\1\2\", 1, 0)/g" | \                                                                            
# sed -e '/http/!d' | \

for file in `ls bor*`;do cat $file | sed -e '/[0-9][0-9]:[0-9][0-9] \/\//d;/[0-9][0-9]:[0-9][0-9]   \*/d;/[0-9][0-9]:[0-9][0-9] \/\*\*/d;/[0-9][0-9]:[0-9][0-9] this\./d' | sed -e '/[0-9][0-9]:[0-9][0-9] cutty/d' | sed -e '/\([0-9][0-9]:[0-9][0-9] \([^ \t]*\) [a-z]:\)\|\([^~]http\)\|\([0-9][0-9]:[0-9][0-9] \([^ \t]\+\) [0-9]\+:\)/!d' | sed -e "s/^\(.*\)/$file \1/g" >> all_logs;done                                                         


cat all_logs | \
 sed -e '/bordom\.net/d' | \
 sed -e "s/bor-2007-\([0-9][0-9]-[0-9][0-9]\) \([0-9][0-9]:[0-9][0-9]\) \([^ \t]\+\) .*http\([^ \t]\+\)/http\4\tftitlef\t\3\t#bor\tfmimetypef\t\1 \2\t\1 \2\t1\t0/g" | \        
 sed -e '/http/!d' >> all_posts


#while IFS="\t" read a b c d e f g h;do b=$(links -source "$a" | sed -e '//!d' | sed -e '/<\/title>/!d' | sed -e 's/.*<title>\(.*\)<\/title>.*/\1/g'); f=$(date --utc --date "2007-$f" +%s); g=$(echo "$f"); echo "$a,$b,$c,$d,$e,$f,$g,$h";done <all_posts > test                                                                                       
#while IFS="    " read a b c d e f g h;do b=$(echo "hi" | sed -e '/<title>/!d' | sed -e '/<\/title>/!d' | sed -e 's/.*<title>\(.*\)<\/title>.*/\1/g'); f=$(date --utc --date "2007-$f" +%s); g=$(echo "$f"); echo "$a\t$b       $c      $d      $e      $f      $g     $h";done <all_posts > restore.sql                                                        


#while IFS=, read a b c d e f g h;do b=$(links -source "$a" | sed -e '/<title>/!d' | sed -e '/<\/title>/!d' | sed -e 's/.*<title>\(.*\)<\/title>.*/\1/g'); f=$(date --utc --date "2007-$f" +%s); g=$(echo "$f"); echo "INSERT INTO items (url,title,author,source,mimetype,time,updated,queued,public) VALUES ($a,$b,$c,$d,$e,$f,$g,$h);";done <all_posts > restore.sql                                                                                 
while IFS="     " read a b c d e f g h;do b=$(echo "put title parser here"); e=$(echo "put mimetype parser here"); f=$(date --utc --date "2007-$f" +%s); g=$(echo "$f"); echo "INSERT INTO items (url,title,author,source,mimetype,time,updated,queued,public) VALUES ('$a','$b','$c','$d','$e','$f','$g','$h');";done <all_posts > restore.sql                 

rm all_posts
rm all_logs</pre>
	
	</div>





</div>

<div id="right">
	




<div style="margin:0.5em 0 0em; font-size:0.75em;">
  <div style="float:left">
<a href="http://www.pastie.org/pastes/70103/text" class="utility"><img alt="View" src="http://assets1.pastie.org/images/view.png?1312786552" style="vertical-align:middle" title="View the raw source of this pastie" /></a>
  </div>
<div style="padding-top:2px; margin-left:70px">
<span style="color:#999">or</span>
<a href="/pastes/70103/download" class="utility or">Download</a>	
</div>
</div>




  <p style="margin-top:1.5em">
  <label>Pasted</label><br />
  <span class="typo_date" title="Wed, 13 Jun 2007 14:10:24 GMT" id='paste_date'>June 13, 2007<br />10:10AM EDT</span>
  <script language="javascript">
  	e=$('paste_date');
  	e.innerHTML=get_local_time_for_date(e.title);
  </script>

  </p>


  







<p>
<label>Embed</label><br />
<input type="text" value="<script src='http://pastie.org/70103.js'></script>" onclick="this.select();" size="25">
</p>



  <p style="margin-top:1.5em;">
        
    
    <a href="/pastes/70103/reply">paste again</a>	
    
  </p>


<!-- <p style="margin-top:3em; font-size:0.6em;">
  
</p> -->



<div class="sponsor">
<label>Sponsored and hosted by:</label>
<a href="http://www.railsmachine.com"><img alt="Rm_badge" src="http://assets3.pastie.org/images/rm_badge.png?1312786552" /></a>
</div>

<div class="ads" style="margin:0 0 1.5em">
<label>Advertising from <a href="http://rubyrow.net/">RubyRow</a>:</label>

<div id="adzerk">
    <div id="adzerk_ad_div">
        <script type="text/javascript" src="http://engine.rubyrow.net/Server/RUBY/PASTIE/HORIZ"></script>
    </div>
    <p id="adzerk_by">
        <a href='http://rubyrow.net'>Ads from Ruby Row</a>
    </p>
</div>
</div>






</div>

<br style="clear:both;" />

<div id="footer">
<p class="disclaim">
<strong>
	
	Use Pastie in your quest to save humanity, not in your evil plots to take over the world!
	</strong>
<br />
<a href="/legal/" style="color:#369;">Legal</a>
</p>

<p class="credit">
  Created by <br />
  <a href="http://blog.pastie.org/">Josh Goebel</a>
</p>
<p class="credit2">
	Monitored by<br />
  <a href="http://www.newrelic.com/?utm_source=PAST&utm_medium=text&utm_content=monitoredby&utm_campaign=RPM&utm_term=0&mpc=TA-PAST-RPM-EN-0-monitored-0">
	New Relic</a>
</p>
<br style="clear:both;" />
</div>

</div>



<script src="http://assets1.pastie.org/javascripts/prototype.js?1312786552" type="text/javascript"></script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-413537-1";
urchinTracker();
</script>
<script type="text/javascript">(function(){var d=document;var e=d.createElement("script");e.async=true;e.src="https://d1ros97qkrwjf5.cloudfront.net/30/eum/rum.js";e.type="text/javascript";var s=d.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s);})();NREUMQ.push(["nrf2","beacon-1.newrelic.com","4f1b2792f0",10734,"Jw4PQUVeXVxXRR8TUBcVBEYYQllfRQ==",0,45,new Date().getTime()])</script></body>
</html>