This topic is locked, you cannot edit posts or make further replies.  [ 1075 posts ]  Go to page Previous  1 ... 34, 35, 36, 37, 38, 39, 40 ... 72  Next
The All-New Improved 24hr Thread 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Blah blah blah!


Thu Aug 20, 2009 6:21 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
:O PAGE 37!


Thu Aug 20, 2009 6:21 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
My knee hurts


Thu Aug 20, 2009 6:22 pm
Profile WWW
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
hai


Thu Aug 20, 2009 6:23 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
General Error
SQL ERROR [ mysql4 ]

Incorrect string value: '\xE2\x88\x9E\xC2\xA7\xC2...' for column 'post_text' at row 1 [1366]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.

D'OH!


Thu Aug 20, 2009 6:23 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Code:
#!/bin/bash
# Author: Ben Lavery
# Date 30th July 2009
# Script will download images from a given photobucket page.

# NOTE FOR POSSIBLE REVISIONS!!!!!
# Consider using wget -i to use a list of URLs,
# or even wget --force-html to pick out the URLs from html file

echo "Starting, this can tke a while"

usage(){
   echo "Usage: bash getpics.sh <destination_folder> <url>"
   exit
}

#Check args (must be 2)
if [ $# -gt 2 ] || [ $# -lt 2 ] || [ $1 = "-h" ] ;
then
   usage
fi

# Collect and set variables
url=$2
output=$1
temp_file="/tmp/webpage.$$"
temp_out="/tmp/tmpout.$$"

# If destination doesn't exist, create it (along with parent folders)
mkdir -p $output

# Get the page
wget --output-document=$temp_file $url >/dev/null 2>&1

# Grab the data
cat $temp_file | grep -i "photobucket.com/albums/" \
| grep -i value | sed 's/\(.*\)\(value=\".*\"\)\(.*\)/\2/g' \
| grep -v readonly | sed 's/value=\"//g' | sed 's/\"//g' > $temp_out

# Download
for each in `cat $temp_out`;
do
   file=`echo $each | sed 's/\(.*\)\/\([^/]*\)/\2/'`
   wget --output-document=$output/$file $each >/dev/null 2>&1
   echo $file - Complete
done

# Cleanup
rm $temp_file
rm $temp_out

echo "All done!"


Thu Aug 20, 2009 6:23 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Code:
#/bin/sh
#Compile an index of given directory

usage(){
   echo "Usage: compile_index <directory_to_index> <index_destination_file>"
   exit
}

#Check args (must be 2)
if [ $# -gt 2 ] || [ $# -lt 2 ] || [ $1 = "-h" ] ;
then
   usage
fi

#Is $1 a directory?
#If so, trim any trailing slashes
if [ -d $1 ] ;
then
   if [ $1 == '.' ] ;
   then
      echo "Please give a more specific directory location for indexing (I.e. not '.')"
      usage
   fi
   DIR=`echo $1 | sed 's/\/$//'`
else
   echo "Directory does not exist"
   usage
fi

#Get and separate destination path and destination file
DEST_DIR=`echo $2 | sed 's/\(.*\)\/\([^/]*\)/\1/'`
DEST_FILE=`echo $2 | sed 's/\(.*\)\/\([^/]*\)/\2/'`
DEST_PATH=$2
mkdir -p $DEST_DIR

TEMP_FILE=/tmp/$$.tmp
find $DIR -type f > $DEST_PATH
cat $DEST_PATH | sed 's/ /%20/g' > $TEMP_FILE
cat $TEMP_FILE | grep -v "\/\." > $DEST_PATH

rm $TEMP_FILE


Thu Aug 20, 2009 6:24 pm
Profile WWW
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
forquare1 wrote:
General Error
SQL ERROR [ mysql4 ]

Incorrect string value: '\xE2\x88\x9E\xC2\xA7\xC2...' for column 'post_text' at row 1 [1366]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.

D'OH!


I got that. :(


Thu Aug 20, 2009 6:24 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
#!/bin/sh
#Script will take and index file and make it into a web page.

usage(){
echo "Usage: html_creator <index_file_location> <output_location.html>"
exit
}

#Check args (must be 2)
if [ $# -gt 2 ] || [ $# -lt 2 ] || [ $1 = "-h" ] ;
then
usage
fi

#Is $1 a file?
if [ -f $1 ] ;
then
INDEX=$1
else
echo "File does not exist"
usage
fi

#Get and separate destination path and file
DEST_DIR=`echo $2 | sed 's/\(.*\)\/\([^/]*\)/\1/'`
DEST_FILE=`echo $2 | sed 's/\(.*\)\/\([^/]*\)/\2/'`
DEST_PATH=$2
mkdir -p $DEST_DIR

#Generate temp file for links
TEMP_FILE=/tmp/$$.tmp
for EACH in `cat $INDEX` ;
do
TEMP_NAME=`echo $EACH | sed 's/\(.*\)\/\([^/]*\)/\2/' | sed 's/[$.].*//' | sed 's/%20/ /g'`
echo " <li><a href='$EACH'>$TEMP_NAME</a></li>" >> $TEMP_FILE
done

#Append html for html file
TEMP_HTML=/tmp/$$.html
PAGE_TITLE=`echo $DEST_FILE | sed 's/\.html//'`
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' >> $TEMP_HTML
echo '<head>' >> $TEMP_HTML
echo " <title>$PAGE_TITLE</title>" >> $TEMP_HTML
echo '</head>' >> $TEMP_HTML
echo '<body>' >> $TEMP_HTML
echo " <h1>$PAGE_TITLE</h1>" >> $TEMP_HTML
echo ' <ol>' >> $TEMP_HTML
cat $TEMP_FILE >> $TEMP_HTML
echo ' </ol>' >> $TEMP_HTML
echo '</body>' >> $TEMP_HTML

#Cleanup
rm $TEMP_FILE
mv $TEMP_HTML $DEST_PATH


Thu Aug 20, 2009 6:24 pm
Profile WWW
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
SO I HERD U LIEK MUDKIPZ?


Thu Aug 20, 2009 6:24 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
themcman1 wrote:
forquare1 wrote:
General Error
SQL ERROR [ mysql4 ]

Incorrect string value: '\xE2\x88\x9E\xC2\xA7\xC2...' for column 'post_text' at row 1 [1366]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.

D'OH!


I got that. :(


Hehe, Random characters FTL apparently!


Thu Aug 20, 2009 6:25 pm
Profile WWW
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
i have web design to do.

ah well.


Thu Aug 20, 2009 6:25 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
What to type...?


Thu Aug 20, 2009 6:25 pm
Profile WWW
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
Most active topic:The All-New Improved 24hr Thread
(216 Posts / 41.46% of your posts)


Thu Aug 20, 2009 6:25 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
themcman1 wrote:
i have web design to do.

ah well.


Go! Get on with it, make out site better!


Thu Aug 20, 2009 6:25 pm
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 1075 posts ]  Go to page Previous  1 ... 34, 35, 36, 37, 38, 39, 40 ... 72  Next

Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.