Skip to content

Instantly share code, notes, and snippets.

@b1nary b1nary/bash.sh
Created Jul 19, 2016

Embed
What would you like to do?
Tweee.co
curl --data "text=Hi there&key=<%= current_api_key %>&media[]=https://example.com/image1.jpg&media[]=https://example.com/image2.jpg" https://tweee.co/api/tweet
var request = require('request');
request.post(
'https://tweee.co/api/tweet',
{ form: {
'key': '<%= current_api_key %>',
'text': 'This is a Tweet! Weee',
'media': [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
]
}},
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
$url = 'https://tweee.co/api/tweet';
$fields = array(
'key' => '<%= current_api_key %>',
'text' => 'This is a Tweet! Weee',
'media' => array(
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
)
);
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
$result = curl_exec($ch);
curl_close($ch);
import requests
url = "https://tweee.co/api/tweet"
data = {
'key': '<%= current_api_key %>',
'text': 'This is a Tweet! Weee',
'media': [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
]
}
print requests.get(url, data=data).text
require 'uri'
require 'net/http'
uri = URI("https://tweee.co/api/tweet")
Net::HTTP.post_form(uri, {
key: "<%= current_api_key %>",
text: "This is a Tweet! Weee",
media: [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.