Social Bookmarking Order Form

Berto

Movin to TX
Jan 3, 2009
3,138
155
0
Proudly Incorporated in WY
wordai.com
So I love and use services like Lalit_Burma or Red_Virus's social bookmarking, but I HATE writing the orders. Writing tags, descriptions, titles, etc. So much that I put off getting my linkbuilding going because of it.

Half of the crap I like to use is already in the meta tags, so I made myself a script to help out. It reads a CSV File, with these fields:

URL # Bookmarks (20, 40,60, 100) Title(s) Use Page Title? Additional Descriptions Category Additional Tags

It then pulls in the meta keywords (for tags), descriptions (semicolon delimited), and other titles you want

Run it from the command line using php -e GenerateSocialBookmarkOrders.php (if you want to run it from the browser you'll have to get rid of the STDIN stuff).

It dumps it to a txt file. Could easily dump it to the screen too.

I still want to completely automate the process of social bookmarks using a web-based language like watir/watin/imacros/etc... and have an odesk job with a few applicants, but haven't fully jumped into it. THat's discussed here.

Note the best coder so no making fun. It works.

Code:
<?php
/**
 * Generate Social Bookmarks - by Berto
 *  http://www.wickedfire.com/members/berto.html
 * 
 *  This file will read SocialBookmarkOrderForm.csv and create an order form
 *  for people like Lalit_Burma.  It will open the URL, get title and meta
 *  information, look at our order form's extra input, and create a .txt
 *  file for an order.
 *
 * Use:  run from command line using php -e GenerateSocialBookmarkOrders.php
 * 
 * Inputs: 1. Will prompt for order name to create a file
 *  2. Row 0: URL
 *  3. Row 1: # Bookmarks (Typically 100, 60, 40, or 20)
 *  4. Row 2: Title(s) - Comma separated list of titles
 *  5. Row 3: Use Page Title?  Y or N ... if Y, it will add URL's Title
 *  6. Additional Descriptions: Add more descriptions, separated by semicolons.
 *     (These are in addition to the meta description)
 *  7. Category:  The main category
 *  8. Additional Tags:  On top of whatever is in the meta keywords.
 *
 * Outputs:
 *  Will create YourOrderName.txt with a list of data from above
 *  Will also output any SEO page errors, such as No Title, or no Meta tags
 */

    // Open input file or die
    $filename = "SocialBookmarkOrderForm.csv";
    $inputFileHandle = fopen($filename, "r");
    if(!$inputFileHandle) {
        echo "Error: Cannot Open SocialBookmarkOrderForm.csv";
        return;
    }

    fwrite(STDOUT, "Please enter the order name: ");
    $orderName = preg_replace('/\s+/','',fgets(STDIN));
    $outputFileHandle = fopen($orderName."-SocialBookmarkOrder.txt", "w"); /
/ Currently overwrites
    if(!$outputFileHandle) {
        echo "Error: Cannot Open $orderName-SocialBookmarkOrder.txt for 
writing";
        return;
    }

    $headerLine = fgetcsv($inputFileHandle); // Trash this...

    $counter = 1;
    while( ($thisLine = fgetcsv($inputFileHandle)) !== FALSE) {
        $url = trim($thisLine[0]);
        $titles = array();
        $descriptions = array();
        $categories = array();
        $tags = array();

        echo "URL: $url\n";

        // Start by pulling any info from the URL...
        $urlTags = get_meta_tags($url);
        $tags = explode(',', $urlTags['keywords']);
        $descriptions[] = $urlTags['description'];
        
        // Grab the URL's Title if Requested
        //  WARNING - This will be the second time downloading the URL..
.
        if(strncasecmp($thisLine[3],'y',1) == 0) { // Compare first char
, case-i
            $urlContents = file($url);
            $urlContents = implode("",$urlContents);
            preg_match("/<title>(.+)<\/title>/i",$urlContents,$match
es);
            if(!empty($matches)) {
                $titles[] = $matches[1];
            } else {
                echo "WARNING: $url has no title\n";
            }
        }
        
        $numBookmarks = trim($thisLine[1]);
        if(!empty($thisLine[2])) {
            $titles = array_unique(array_merge($titles, explode(',',
 $thisLine[2])));
        }
        array_walk($titles, 'trim_array');
        // print_r($titles);

        if(!empty($thisLine[4])) {
            $descriptions = array_unique(array_merge($descriptions, 
explode(';', $thisLine[4])));
        }
        array_walk($descriptions, 'trim_array');
        // print_r($descriptions);

        $categories = trim($thisLine[5]); // Just leave it however I wri
te it..

        if(!empty($thisLine[6])) {
            $tags = array_unique(array_merge($tags, explode(',', $th
isLine[6])));
        }
        array_walk($tags, 'trim_array');
        shuffle($tags);
        // print_r($tags);
        fwrite($outputFileHandle, "Item " . $counter . ".\n\n - URL: $ur
l\n\n");
        foreach($titles as $i => $title) {
            fwrite($outputFileHandle, " - Title $i - " . $title . "\
n");
        }
        fwrite($outputFileHandle, "\n");

        foreach($descriptions as $i => $description) {
            fwrite($outputFileHandle, " - Description $i - " . $desc
ription . "\n");
        }
        fwrite($outputFileHandle, "\n");
    
        fwrite($outputFileHandle, " - Category - " . $categories . "\n\n
 - Tags - ");
        $tagOutput = implode($tags, ', ');

        fwrite($outputFileHandle, "$tagOutput\n\n");

        $counter++;
    }

    fclose($inputFileHandle);
    fclose($outputFileHandle);


    function trim_array(&$value) {
        // From http://php.net/manual/en/function.trim.php
        $value = trim($value);
    }
?>
 

Attachments



Fuck I'm drunk and retarded. My output never put out the # of bookmarks requested.

You just need to add this line somewhere:

fwrite($outputFileHandle, " - # Bookmarks: $numBookmarks\n\n");


Fixed version:
Code:
<?php
/**
 * Generate Social Bookmarks - by Berto
 *  http://www.wickedfire.com/members/berto.html
 * 
 *  This file will read SocialBookmarkOrderForm.csv and create an order form
 *  for people like Lalit_Burma.  It will open the URL, get title and meta
 *  information, look at our order form's extra input, and create a .txt
 *  file for an order.
 *
 * Use:  run from command line using php -e GenerateSocialBookmarkOrders.php
 * 
 * Inputs: 1. Will prompt for order name to create a file
 *  2. Row 0: URL
 *  3. Row 1: # Bookmarks (Typically 100, 60, 40, or 20)
 *  4. Row 2: Title(s) - Comma separated list of titles
 *  5. Row 3: Use Page Title?  Y or N ... if Y, it will add URL's Title
 *  6. Additional Descriptions: Add more descriptions, separated by semicolons.
 *     (These are in addition to the meta description)
 *  7. Category:  The main category
 *  8. Additional Tags:  On top of whatever is in the meta keywords.
 *
 * Outputs:
 *  Will create YourOrderName.txt with a list of data from above
 *  Will also output any SEO page errors, such as No Title, or no Meta tags
 */

    // Open input file or die
    $filename = "SocialBookmarkOrderForm.csv";
    $inputFileHandle = fopen($filename, "r");
    if(!$inputFileHandle) {
        echo "Error: Cannot Open SocialBookmarkOrderForm.csv";
        return;
    }

    fwrite(STDOUT, "Please enter the order name: ");
    $orderName = preg_replace('/\s+/','',fgets(STDIN));
    $outputFileHandle = fopen($orderName."-SocialBookmarkOrder.txt", "w"); /
/ Currently overwrites
    if(!$outputFileHandle) {
        echo "Error: Cannot Open $orderName-SocialBookmarkOrder.txt for 
writing";
        return;
    }

    $headerLine = fgetcsv($inputFileHandle); // Trash this...

    $counter = 1;
    while( ($thisLine = fgetcsv($inputFileHandle)) !== FALSE) {
        $url = trim($thisLine[0]);
        $titles = array();
        $descriptions = array();
        $categories = array();
        $tags = array();

        echo "URL: $url\n";

        // Start by pulling any info from the URL...
        $urlTags = get_meta_tags($url);
        $tags = explode(',', $urlTags['keywords']);
        $descriptions[] = $urlTags['description'];
        
        // Grab the URL's Title if Requested
        //  WARNING - This will be the second time downloading the URL..
.
        if(strncasecmp($thisLine[3],'y',1) == 0) { // Compare first char
, case-i
            $urlContents = file($url);
            $urlContents = implode("",$urlContents);
            preg_match("/<title>(.+)<\/title>/i",$urlContents,$match
es);
            if(!empty($matches)) {
                $titles[] = $matches[1];
            } else {
                echo "WARNING: $url has no title\n";
            }
        }
        
        $numBookmarks = trim($thisLine[1]);
        if(!empty($thisLine[2])) {
            $titles = array_unique(array_merge($titles, explode(',',
 $thisLine[2])));
        }
        array_walk($titles, 'trim_array');
        // print_r($titles);

        if(!empty($thisLine[4])) {
            $descriptions = array_unique(array_merge($descriptions, 
explode(';', $thisLine[4])));
        }
        array_walk($descriptions, 'trim_array');
        // print_r($descriptions);

        $categories = trim($thisLine[5]); // Just leave it however I wri
te it..

        if(!empty($thisLine[6])) {
            $tags = array_unique(array_merge($tags, explode(',', $th
isLine[6])));
        }
        array_walk($tags, 'trim_array');
        shuffle($tags);
        // print_r($tags);
        fwrite($outputFileHandle, "Item " . $counter . ".\n\n - URL: $ur
l\n");
        fwrite($outputFileHandle, " - # Bookmarks: $numBookmarks\n\n");
        foreach($titles as $i => $title) {
            fwrite($outputFileHandle, " - Title $i - " . $title . "\
n");
        }
        fwrite($outputFileHandle, "\n");

        foreach($descriptions as $i => $description) {
            fwrite($outputFileHandle, " - Description $i - " . $desc
ription . "\n");
        }
        fwrite($outputFileHandle, "\n");
    
        fwrite($outputFileHandle, " - Category - " . $categories . "\n\n
 - Tags - ");
        $tagOutput = implode($tags, ', ');

        fwrite($outputFileHandle, "$tagOutput\n\n");

        $counter++;
    }

    fclose($inputFileHandle);
    fclose($outputFileHandle);


    function trim_array(&$value) {
        // From http://php.net/manual/en/function.trim.php
        $value = trim($value);
    }
?>
 
Got this error from command prompt:
'php' is not recognized as an internal or external command,
operable program or batch file.


does that mean i dont have php?
 
Got this error from command prompt:
'php' is not recognized as an internal or external command,
operable program or batch file.


does that mean i dont have php?

Not+Sure+if+serious.jpg
 
I only just started recently buying social bookmarks (never needed to before) and though the same exact fucking thing.. Like you, I want to automate it fully though; I wish lalit/red virus offered up an API in which you can interface and add your jobs.
 
I only just started recently buying social bookmarks (never needed to before) and though the same exact fucking thing.. Like you, I want to automate it fully though; I wish lalit/red virus offered up an API in which you can interface and add your jobs.

@Red_Virus @Lalit_Burma, take notice and do this.

What I'd like to have is a control panel where I'd deposit a $100 credit, then just submit my small orders through a form and come back a couple of days later for the reports.

Emailing and paypaling $3 for small jobs is such a nuisance, I just don't want do it and instead wake up my BMD for a massive pligg submission.
 
Sounds like there's a lot of BMD users here. Should I re-consider using this software? About how many bookmarks on average do you get with it? What's the pain-in-the-ass factor?

I have BookmarkWiz and it's junk, but I do like how it pulls in the Title and Meta Description when you add a URL. This is where the idea came for this script.
 
I only just started recently buying social bookmarks (never needed to before) and though the same exact fucking thing.. Like you, I want to automate it fully though; I wish lalit/red virus offered up an API in which you can interface and add your jobs.

There is definitely a market here for a "DripFeedSocialBookmarks" type service.

1. Get a REALLY GOOD browser-based automated account creation/bookmarking solution on a VPS/Dedi with top 100 sites and maybe 100 other pliggs
2. Build web panel, API, etc.
3. Get crapload of proxies
4. Hire Guerilla
5. Profit

I have no interest in doing such a thing since it's so far from my core business platform, but it'd be on less pain in my butt
 
I need 2 things:

1. Social bookmarking service that lets me submit keywords/urls via an API
2. Xrumer service that lets me submit keywords/urls via an API

Will pay top dollar. PM me if you can make it happen.