Changeset 1372
- Timestamp:
- 03/03/07 20:28:47 (2 years ago)
- Files:
-
- feedmelinks/bin/import-bookmarks.pl (modified) (4 diffs)
- feedmelinks/import/index.php (modified) (1 diff)
- feedmelinks/import/ready-to-import.php (modified) (4 diffs)
- feedmelinks/modules/utils.inc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/bin/import-bookmarks.pl
r857 r1372 1 1 #!/usr/bin/perl 2 use FeedMeLinks::Environment; 3 use File::Temp qw/ :mktemp /; 4 5 2 6 $glc = 0; 3 7 4 #p( "convert line-endings to unix" ); 5 #p( "determine browser" ); 6 7 my ($link, $tag, @tags, @links, @folks, $hideGarbage, $dd, $glc, $mandatory_tag, $path); 8 my ($link, $tag, @tags, @links, @folks, $hideGarbage, $dd, $glc, $mandatory_tag, $path, $bin, $format); 8 9 9 10 $link = $tag = undef; … … 18 19 # extract the user name from the file path (this practice oculd be considered a bit shady...) 19 20 $path = $filename = $ARGV[0]; 20 $parser = $ARGV[1];21 $link_xslt = $ARGV[2];22 $tag_xslt = $ARGV[3];21 $parser = $ARGV[1]; 22 $link_xslt = $ARGV[2]; 23 $tag_xslt = $ARGV[3]; 23 24 $path =~ s:\/([^/]+)$::; #strip filename 24 #$path =~ s:.*\/([^/]+)$:$1:; #strip all but parent dir 25 $bin = FeedMeLinks::Environment::get_webserver_root() . "/bin"; 26 27 ($fh, $converted) = mkstemp( "bookmark_conversion_XXXX" ); 28 # one of: delicious-hybrid, netscape, delicious-API 29 $format = detect_bookmarks_format( $bin, $filename ); 30 print "format: $format\n"; 31 if( $format == "delicious-hybrid" ) { 32 $cmd = "$bin/hybrid-to-xml.pl $filename > $converted"; 33 print "cmd: $cmd\n"; 34 $out =`$cmd`; 35 print "converted is $converted\n out is : $out\n"; 36 $filename = $converted; 37 } 38 39 exit; 25 40 26 41 while( <> ) { … … 112 127 add_pending_link_or_tag(); 113 128 write_raw_files(); 129 unlink( $converted ); 130 114 131 exit( 0 ); 115 132 116 133 ## END ## 117 134 135 sub detect_bookmarks_format { 136 my( $bin, $filename) = @_; 137 my $cmd = "$bin/detect-bookmarks-file-format.sh $filename"; 138 my $out = `$cmd`; 139 return $out; 140 } 118 141 119 142 sub write_raw_files() { … … 172 195 #print "DEBUG> " . $_[0] . "\n"; 173 196 } 197 feedmelinks/import/index.php
r1365 r1372 27 27 $path = $b["path"]; 28 28 29 echo "dir $dir, path $path";30 31 29 $show_form = true; 32 30 feedmelinks/import/ready-to-import.php
r1328 r1372 1 <% include_once( "../modules/utils.inc.php" ); 1 <?php 2 include_once( "../modules/utils.inc.php" ); 2 3 3 4 $u = $sessionUserId = $_COOKIE["c_uid"]; … … 7 8 include_once( "$modules/header.inc.php" ); 8 9 9 %>10 ?> 10 11 <br /> 11 < %12 <?php 12 13 13 14 $b = get_bookmarks_info( $u ); … … 59 60 60 61 } else { 61 fatal( " Wow! You have a very nice collection of links. Because you have approximately " . $ls . " links and " . $ts . " tags, your import has bene 'flagged for review' by our team to make sure everything is imported correctly. A notice has been sent to the team and they will be in contact with you shortly to finish the import process. <p />Thanks very much,<p /> -- <a href='http://jm3.net/'><b>John Manoogian III</b></a><br /> <a href='http://codeswami.com'>Code Swami</a>: Feed Me Links" );62 fatal( "Hello, new users' link uploads are autmatically capped to protect against spamming. You import has been 'flagged for review'. An admin will contact you shortly to finish the import process. <p />Sorry for the inconvenience,<p /> -- <a href='http://jm3.net/'><b>John Manoogian III</b></a><br /> <a href='http://codeswami.com'>Code Swami</a>: Feed Me Links" ); 62 63 63 64 $headers = ""; … … 83 84 echo bounceTo( $site . "/login?bounceToPage=import/" ); 84 85 } 85 %>86 ?> feedmelinks/modules/utils.inc.php
r1360 r1372 2423 2423 } else if( $argWhichQuery == "tag" ) { 2424 2424 return " 2425 SELECT * FROM links, tags AS t, links_tags_xref AS x WHERE x.tagID = " . urlencode( $args[1] ) . " AND x.linkID = links.ID AND t.ID = x.tagID AND userid = '"2425 SELECT * FROM links, tags AS t, links_tags_xref AS x WHERE x.tagID = " . urlencode( $args[1] ) . " AND x.linkID = links.ID AND t.ID = x.tagID AND links.userid = '" 2426 2426 . urlencode( $args[2] ) ."';"; 2427 2427