标签: pastebin

带有PasteBin API的jQuery $ .post

好,

我正在尝试使用带有PasteBin API的 jQuery $ .post 来创建一个PasteBin页面并获取URL(API说它返回).到目前为止,这是我的代码:

$('#send_code').click(function(){
    $.post('http://pastebin.com/api_public.php', 
            { paste_name: $('#paste_name').val(), paste_code: $('#paste_code').val() },
            function(data){
                alert(data);
            });
}
Run Code Online (Sandbox Code Playgroud)

上面的脚本创建页面就好了(我可以在PasteBin上找到它们).但是,返回的所有内容都是空字符串.我试过用php和cURL使用这个相同的API,我能够很好地检索URL.谁能看出我做错了什么?谢谢!

jquery post pastebin

5
推荐指数
1
解决办法
980
查看次数

使用Google Apps脚本和Pastebin.com API发布粘贴

我正在尝试使用电子表格脚本编辑器中的Google Apps脚本粘贴Pastebin.com 。谁能告诉我我在做什么错?

function postPastebinPost() {
  var options, url, apiKey, payload, response;

  apiKey = <api key goes here>;
  payload = 'Hello World';

  options = {
    'method' : 'post',
    'payload' : payload
  };

  url = 'https://pastebin.com/api/api_post.php'
    + '?api_dev_key=' + apiKey
    + '&api_option=paste'
    + '&api_paste_code=' + encodeURIComponent(payload);

  response = UrlFetchApp.fetch(url, options);
  Logger.log(response);
}
Run Code Online (Sandbox Code Playgroud)

我运行此命令,日志显示为Bad API request, invalid api_option。我正在寻找解决方案,但没有找到任何解决方案。

说明文件:

Pastebin.com API

•Google Apps脚本的UrlFetchApp类

pastebin google-sheets google-apps-script google-apps-script-api

4
推荐指数
1
解决办法
295
查看次数

使用bash或curl粘贴到codepad.org

如何使用curl从命令行粘贴到codepad.org?

bash curl pastebin

3
推荐指数
1
解决办法
2266
查看次数

Pastebin c#自动上传

我需要我的应用程序上传输出到pastebin但我不能让它工作这是代码

        WebRequest wr = WebRequest.Create(@"http://pastebin.com/api_form.php");
        ASCIIEncoding encoding = new ASCIIEncoding();
        byte[] bData = encoding.GetBytes(string.Concat("paste_code=", sOutput, "&paste_private=0&paste_expire_date=1D&paste_subdomain=c4ca4238a0b923820dcc509a6f75849b"));
        wr.Method = "POST";
        wr.ContentType = "application/x-www-form-urlencoded";
        wr.ContentLength = bData.Length;
        Stream sMyStream = wr.GetRequestStream();
        sMyStream.Write(bData, 0, bData.Length);
        sMyStream.Close();
Run Code Online (Sandbox Code Playgroud)

http://pastebin.com/api.php < - apis来自那里

c# pastebin

1
推荐指数
1
解决办法
1571
查看次数

Sha1子串问题

我正在制作一个pastebin类型的网站,我正在尝试将id设为随机字符串,如paste.com/4RT65L

在我将它添加到数据库之前我得到了id的sha1但是我得到了sha1的前8个字符的子字符串.他们是否有可能成为同一个sha1的双重副本?我不希望他们意外地成为第二个已经使用过id的粘贴?

php sha1 pastebin

1
推荐指数
1
解决办法
1284
查看次数

使用 pastebin API 发出一个简单的 POST 请求

我想知道如何向 pastebin.com 发出帖子请求。他们有一个易于理解的API 文档,但是每当我运行一个简单的 POST 请求时,我总是得到Bad API request, invalid api_option.

我正在使用提出请求所需的最低限度,我不确定我可能做错了什么。

var request = new XMLHttpRequest; request.open("POST", "https://pastebin.com/api/api_post.php?api_dev_key=mykey&api_option=paste&api_paste_code=hi", false); request.send(); request.response;

javascript jquery xmlhttprequest pastebin

1
推荐指数
1
解决办法
3585
查看次数

PHP引发PHP开始/结束字符之外的代码错误

我有一个PHP页面,不断引发错误

PHP Parse error: syntax error, unexpected '<' in /home/zach/public_html/date/giftsent1.php on line 30
Run Code Online (Sandbox Code Playgroud)

有趣的是,第30行是在HTML中.它是在PHP结束字符(?>)之后.

我已将代码添加到Pastebin:

http://pastebin.com/Dsh0KwdA

php pastebin

0
推荐指数
1
解决办法
71
查看次数

通过 API 编辑现有的 Pastebin 文档

我正在尝试在 LUA 中编写一个函数来编辑我的 pastebin 代码。

我可以使用此代码制作 HTTP 帖子:

http.post(string url, string postData [, table headers])

我也可以使用此代码进行 HTTP 获取:

http.get(string url [, table headers])

Pastebin 网站https://pastebin.com/api上提供了有关使用 API 的信息。我不确定,如果这个网站可以帮助我解决我的问题。

有人知道如何填写标题表吗?

这是我试过的程序:

headers = {}
headers["api_dev_key"]= 'myDevKey...'; // your api_developer_key
headers["api_paste_code"]   = 'my edited text'; // your paste text
headers["api_paste_private"] = '0'; // 0=public 1=unlisted 2=private
headers["api_paste_name"] = 'justmyfilename.php'; // name or title of your paste
headers["api_paste_expire_date"] = '10M';
headers["api_paste_format"] = 'php';
headers["api_user_key"] = ''; // if an invalid or expired …
Run Code Online (Sandbox Code Playgroud)

lua http pastebin

0
推荐指数
1
解决办法
5241
查看次数