Created
July 19, 2016 08:49
-
-
Save b1nary/2af44e9b0f072002f007417ddc0e14e9 to your computer and use it in GitHub Desktop.
Tweee.co
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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