Jump to content

Forum script based on pastebin/nopaste text data.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
fatof

fatof

    Newbie

  • Members
  • Pip
  • 9 posts
Hi again!

I've got a question, did any of you know if there is a forum script completely based on data posted to popular paste-services pastebin alike? I mean that all of data is transfered (fsocks) to pastebin and than all links are catalogued into one text data and all that is keeped on hosting in single link + php files and no other stuff.

Why I am asking? Because I know that this is possible (in perl, bash and c#) e.g.:

#!/bin/bash

#Pastebin poster, created by Jaku


#Username

USER="jaku_bin"

#Data retainment (d=1 day, m=1 month, f=forever)

RETAIN="d"

#Default Text type (too many to list)

TEXT="None"

#Default pastbin URL

URL="pastebin.com/pastebin.php"


while read input; do

CODE="$CODE

$input"

done


curl -i -d "code2=$CODE&paste=Send&expiry=$RETAIN&poster=$USER&format=$TEXT" $URL -s| grep -i Location:

#!/usr/bin/perl -w

#

#	Author:		Fred Blaise <chapeaurouge_at_madpenguin_dot_org>

#	Date:		21 Nov 2005

#	Purpose:	Make it easy to paste a file to pastebin.ca

#

#	Updated:	29 May 2007 by Stephen Olesen <admin at pastebin dot ca>

#

# This program is free software; you can redistribute it and/or modify

# it under the terms of the GNU General Public License as published by

# the Free Software Foundation; either version 2 of the License, or

# (at your option) any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

# GNU General Public License for more details.

#  

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

use strict;

use WWW::Mechanize;

use Getopt::Long;


# Types of text, and their option number

# 

# [22/ASP|18/Action Script|19/Ada Source|20/Apache Configuration|21/Assembly (NASM)|2/Asterisk Configuration|23/BASH Script|3/C Source|9/C# Source|4/C++ Source|24/CSS|25/Delphi Source|26/HTML 4.0 Strict|7/Java Source|27/JavaScript|28/LISP Source|29/Lua Source|30/Microprocessor ASM|31/Objective C|5/PHP Source|14/PL/I Source|12/Pascal Source|6/Perl Source|11/Python Source|*1/Raw|10/Ruby Source|16/SQL Statement|17/Scheme Source|32/Visual Basic .NET|8/Visual Basic Source|15/XML Document|13/mIRC Script]


# Expiry options

#  [*/Never|5 minutes|10 minutes|15 minutes|30 minutes|45 minutes|1 hour|2 hours|4 hours|8 hours|12 hours|1 day|2 days|3 days|1 week|2 weeks|3 weeks|1 month|2 months|3 months|4 months|5 months|6 months|1 year]


# api_key is used for spam protection methods, do not adjust this or pastes may fail

my $api_key       = "hS5Xpk1VbjFLB9EJn2wHwkEwi50xEVPl";

my $pastebin_url  = "http://pastebin.ca/quiet-paste.php?api=$api_key";

my $pastebin_root = "http://pastebin.ca";


my %f = (

	content		=>	'',

	description	=>	'',

	type		=>	'1',

	expiry		=>	'Never',

	name		=>	'clueless',

);


GetOptions ( \%f,

		"content=s",

		"description=s",

		"type=i",

		"expiry=s",

		"name=s"

) || die $!;


my $boy = WWW::Mechanize->new();


$boy->get($pastebin_url);


die $! unless ($boy->success());


unless ($f{content}) {

## -- Commented this out since it can be identified by API key

#	$f{description} = $ARGV[0];

#	$f{description} .= " -- automated paste by paste2pastebin.pl";

	$f{content} = join "", <>;

}


$boy->form_name('pasteform');

$boy->set_fields(%f);

$boy->submit_form( button => 's');


die unless ($boy->success);


my $content = $boy->content();

if($content =~ m/^SUCCESS:(.*)/) {

    print "Your paste URL is: " . $pastebin_root . "/" . $1 . "\n";

} else {

    print $content;

}

try

{

 

    HttpWebRequest request = (HttpWebRequest)

        WebRequest.Create("http://davux.pastebin.com/pastebin.php");

 

    request.AllowAutoRedirect = false;

    request.Method = "POST";

 

    string post = "&parent_pid=&format=text&code2=" + HttpUtility.UrlEncode(text) + "&poster=Dave&paste=Send&expiry=m&email=";

    byte[] data = System.Text.Encoding.ASCII.GetBytes(post);

 

    request.ContentType = "application/x-www-form-urlencoded";

    request.ContentLength = data.Length;

 

    Stream response = request.GetRequestStream();

 

    response.Write(data,0,data.Length);

 

    response.Close();

 

    HttpWebResponse res =(HttpWebResponse) request.GetResponse();

    res.Close();

    // note that there is no need to hook up a StreamReader and

    // look at the response data, since it is of no need

 

    if (res.StatusCode == HttpStatusCode.Found)

    {

        Console.WriteLine(res.Headers["location"]);

    }

    else

    {

        Console.WriteLine("Error");

    }

 

}

catch (Exception ex)

{

    Console.WriteLine("Error: " + ex.Message);

}

But this isn't the only reason. I want to use forum script working like this (with pastebin and a mirror to prevent timeout when one of these is offline) to release full power of hostings with unlimited bandwidth, but also limited storage (to, like, 5 megs). If that kind of script exist I will be very appreciated when you post it's name here in this thread. I think that millions of people either :).

Regards,
fatof

-edit1-

Another idea is storing forum data on mail (there are many mail-services with unlimited storage and fast servers, so it would be nice).

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
Are you meaning an automated solution to paste a forum post to pastebin?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
fatof

fatof

    Newbie

  • Members
  • Pip
  • 9 posts
@Nullw0rm not exacly. There are solutions to put with fsock something into pastebin and even to get something from pastebin using tags and strcmp, but I am looking for open source project of forum - bulletin board, which use this technic, or technic post-2-mail-2-post, to avoid using space of free webhosting. And my question is did someone know name of that kind of project, nothing more.

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
I had looked briefly and cannot find a single thing, I personally doubt there would ever be a need of that service. Space today is getting cheaper and cheaper, how do you think free hosts are allowing hundreds of gigabytes?

Four hundred thousand requests a month on a page that is 500KBs will never break 2 gigabytes.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
fatof

fatof

    Newbie

  • Members
  • Pip
  • 9 posts
Traffic is not the issue here (because forum would act like proxy, maybe not with mail-storage, but with pastebin it would be). That kind of script would be perfect, because nobody want to pay for anything if everybody can take it for free. Why I need to pay for hosting if I can store data elsewhere and just download it from there? I don't need to pay :). So that's it and I've also have been researching, and I've found nothing. That is the reason why I am here, because exprienced programmers are always nearer than me with high tec and new tec :).

#6
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
But you still have to pay for the forum you say you will use as some sort of proxy, right? So what's the whole point? Why don't you just get a free website if that's what you want? There's thousands of free hosts.

#7
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
Plus the fact you will be doubling bandwidth output per forum request. Forums generally use archives (lo-fi basic forum posts) often on another cheaper server for search engines to follow instead of the heavier main thread
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#8
fatof

fatof

    Newbie

  • Members
  • Pip
  • 9 posts
You both misunderstood.

I am looking for forum script coded in PHP which I will put on free web hosting with e.g. 100 mb disc space and unlimited bandwidth. Normally forum with ~100000 post exceed 100 mb of disc space and no one won't start any new thread or write a post. So what I am looking for is script which write post data and thread data, and every data "live" to pastebin or mail and read this from there if a user view the page (page with forum script, with only forum script files {PHP} on ftp). Schema looks like this:

ftp = script files (only PHP)
PHP = fsocks to pastebin or connection to smtp and download (read) templates, images and other data (including posts, threads, user lists, etc.)
user = he/she write post/thread and PHP script send this to pastebin or mail and rewrite link/message id to global links/message id paste or message so in consecuence first PHP script (when user visit forum) will have preset base link/message id and no storage of free hosting would be used (data is stored on free and unlimited in size pastebin or in unlimited and free post service, like yahoo)
admin = preset paste or mail with acc data stored as a link/message id in base link/message id

And these are the basics of what I am looking for AND I don't look for programmer who code that, I search for existing project (which is coded and open source or commercial - no matter).

#9
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
I think we both understood that, at least I did and I sure Nullw0rm did too.

#10
fatof

fatof

    Newbie

  • Members
  • Pip
  • 9 posts

Quote

But you still have to pay for the forum you say you will use as some sort of proxy, right? So what's the whole point?

I was talking about that. I don't need to pay with that kind of script, because everything is free or if script is commercial I purschase license once and that's it, no more paying. And no more backups, long backups, because I can forward all mails or paste to mirror site without using my connection.

Point is to have everything for free and with fantastic performance.

#11
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
It wont have fantastic performance.

Quote

user browser => your website => external website => back to your website => back to user browser

Plus you would need to keep track of which id corresponds to which website URL, so your going to have a growing DB regardless. And I dont think the owner(s) of websites like pasties would like the idea of this going on. You could very well end up having your server IP blocked on their side.

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it