GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   any developers code shell scripts? (https://gfy.com/showthread.php?t=888391)

fris 02-17-2009 09:07 AM

any developers code shell scripts?
 
anyone code bash shell scripts?

leave your contact info

thanks.

PowerCum 02-17-2009 09:21 AM

Usually people would say "See sig"

In this case I can only say... Look at YOUR sig :)

fris 02-17-2009 09:24 AM

ya, they dont do shell scripting, or else i wouldnt have made the post

PowerCum 02-17-2009 09:34 AM

Search round on freshmeat and sourceforge.
Unless you need something really complex it's probably done already.

Image resizing, movies pics extraction and so on... there are like 500 scripts that do these tasks.

fris 02-17-2009 09:36 AM

Quote:

Originally Posted by PowerCum (Post 15507430)
Search round on freshmeat and sourceforge.
Unless you need something really complex it's probably done already.

Image resizing, movies pics extraction and so on... there are like 500 scripts that do these tasks.

need something custom, but not complex.

its for posting to a source code site from the command line.

one of the parameters is tags:

tag1,tag2,tag3

not sure how to parse that in a shell script

nation-x 02-17-2009 10:09 AM

why does it need to be a "bash" shell script? You can run perl, php, etc from the shell.

http://www.phpbuilder.com/columns/darrell20000319.php3

mrkris 02-17-2009 10:13 AM

Quote:

Originally Posted by nation-x (Post 15507664)
why does it need to be a "bash" shell script? You can run perl, php, etc from the shell.

My thoughts exactly.

nation-x 02-17-2009 10:19 AM

Code:

#!/usr/local/bin/php -q
<?php
// $argc contains the count of arguments passed
echo "Total argument passed are : $argc \n";

if ($argc) {
        // $argv contains an array of the arguments that were passed
        foreach($argv as $arg) {
                echo $arg."\n";
        }
}
?>


nation-x 02-17-2009 10:22 AM

Quote:

Originally Posted by PowerCum (Post 15507375)
Usually people would say "See sig"

In this case I can only say... Look at YOUR sig :)

stfu... real webmasters are posting... not thieving bitches

fuzebox 02-17-2009 10:40 AM

Generally for command line stuff I just do it in perl.

tranza 02-17-2009 12:14 PM

Quote:

Originally Posted by nation-x (Post 15507747)
Code:

#!/usr/local/bin/php -q
<?php
// $argc contains the count of arguments passed
echo "Total argument passed are : $argc \n";

if ($argc) {
        // $argv contains an array of the arguments that were passed
        foreach($argv as $arg) {
                echo $arg."\n";
        }
}
?>


Thanks for this bro! ;) :thumbsup

doridori 02-17-2009 12:20 PM

see see sig

nation-x 02-17-2009 03:17 PM

Quote:

Originally Posted by tranza (Post 15508605)
Thanks for this bro! ;) :thumbsup

np.. :thumbsup

doridori - go eat a sick dick punk

fris 02-17-2009 07:08 PM

this basically does what i want it to do, but in perl

Code:

#!/usr/bin/perl -w

use strict;
use Frontier::Client;

my $apikey = 'APIKEYHERE';       
my $src = 'sourcecode.phps';
my $title='test post';
my $code = '';
my $tags = 'tag1 tag2 tag3';
my $language = 'php';
my $flag = 0;

open(FC, "<:utf8", $src);
while (<FC>) {
        if (/^\#[^!]\s*(.+)/ && $flag == 0) {
                $title = $1;
                $flag++;
        }
        elsif (/^\#[^!]\s*(.+)/ && $flag == 1) {
                $tags = $1;
                $flag++;
                if (/(\w+) (.+)/) {
                        $language = $1;
                        $tags = $2;
                }
        }
        $code = $code . $_;
}

my $session = Frontier::Client->new( url => 'http://snipplr.com/xml-rpc.php', debug => 0,);
my @args = ($apikey, $title, $code, $tags, $language);
my $result = $session->call('snippet.post', @args);

the command line version of it using the snipplr ruby gem would be

Code:

snipplr -c -meta ":title=>'test post',:tags=>'tag1 tag2 tag3',:language=> 'php'" < sourcode.phps

k0nr4d 02-18-2009 03:30 AM

It sounds to me like the 'curl' command line does exactly what you are after...
http://curl.haxx.se/docs/manpage.html

...or i might have misread completely.

nation-x 02-18-2009 06:18 AM

hehe... today is the first time I ever looked at snipplr... how funny


All times are GMT -7. The time now is 02:53 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123