Skip to content

engageRename cla.yml to cla.ympythonengage #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: add_tls_to_urls
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5b03096
[bug fix] Stop manual URI parsing/escaping and use CGI::parse (#119)
smaeda-ks Dec 4, 2019
1890ab9
make username option settable on requests (#125)
smaeda-ks Dec 4, 2019
65632de
Use IO.binread instead of IO.read (#110)
smaeda-ks Dec 4, 2019
6fb3c08
Fix PIN authorization (#111)
raethlo Dec 6, 2019
d037cf6
Add twurl version to user agent header (#126)
smaeda-ks Dec 8, 2019
c872a7d
Update Code-Of-Conduct / LICENSE (#127)
smaeda-ks Dec 9, 2019
ded1136
Add --timeout and --connection-timeout options (#128)
smaeda-ks Dec 10, 2019
5a7cee4
Make aliases work again Closes: #93 (#114)
flaviomartins Dec 10, 2019
03984a2
Release v0.9.4 (#129)
smaeda-ks Dec 10, 2019
d082264
Support authorization options on request (#131)
smaeda-ks Dec 13, 2019
f81ec26
Add -j (--json-pretty) option (#130)
smaeda-ks Dec 16, 2019
1f6dcac
Documentation improvements (#133)
andypiper Dec 17, 2019
3a1a055
fix newline in README (#134)
andypiper Dec 17, 2019
e9cb1a0
Support Bearer Token (#132)
smaeda-ks Dec 26, 2019
f276355
bump version -> v0.9.5 (#135)
smaeda-ks Dec 26, 2019
b9818b8
Fix .gemspec (#136)
smaeda-ks Dec 26, 2019
4e8b5f9
Add Ruby 2.7.0 to .travis.yml (#137)
smaeda-ks Dec 27, 2019
23a8374
Add VSCode remote container setting files (#138)
smaeda-ks Dec 30, 2019
0dd7c29
Doc fix (#140)
andypiper Dec 30, 2019
837882d
Update INSTALL.md
andypiper Dec 30, 2019
3c78a05
Set theme jekyll-theme-modernist
andypiper Jun 30, 2020
138c978
2020-03 patch (#145)
smaeda-ks Aug 27, 2020
f986f11
prepare 0.9.6 release (#152)
andypiper Aug 27, 2020
73593e5
Update issue templates
andypiper Sep 11, 2020
f7c6a14
Create config.yml
andypiper Sep 11, 2020
671ef6c
Delete ISSUE_TEMPLATE.md
andypiper Sep 11, 2020
f89553f
Update issue templates
andypiper Sep 11, 2020
6c2f7bb
Update config.yml
andypiper Sep 11, 2020
1dff739
Add .github/workflows/cla.yml through file_replicator. (#162)
twitter-service Feb 11, 2021
96ee80d
Use https for GitHub link (#174)
mishina2228 Apr 15, 2022
3604e65
Migrate CI from Travis CI to GitHub Actions (#173)
mishina2228 Apr 15, 2022
3d8a490
0.9.7 (#161)
smaeda-ks Apr 26, 2023
c256756
bump version -> v0.9.7
smaeda-ks Apr 26, 2023
9747b0d
Rename cla.yml to cla.ympythonengage
richbloodfuckin Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Documentation improvements (#133)
* Documentation improvements

* Adding suggestions from #62

* fixing contributors in readme
  • Loading branch information
andypiper authored Dec 17, 2019
commit 1f6dcac19db0a3967801b716006e508dbccd0bc6
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -36,4 +36,5 @@ test/version_tmp
tmp
tmtags
tramp
vendor
.vscode
vendor
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How to Contribute

We'd love to get patches from you!

## Getting Started

We follow the [GitHub Flow Workflow](https://guides.github.com/introduction/flow/)

1. Fork the project
2. Check out the `master` branch
3. Create a feature branch
4. Write code and tests for your change
5. From your branch, make a pull request against `twitter/twurl/master`
6. Work with repo maintainers to get your change reviewed
7. Wait for your change to be pulled into `twitter/twurl/master`
8. Delete your feature branch

## License

By contributing your code, you agree to license your contribution under the
terms of the MIT License: https://github.com/twitter/twurl/blob/master/LICENSE

## Code of Conduct

Read our [Code of Conduct](CODE_OF_CONDUCT.md) for the project.
65 changes: 39 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Twurl
=====

[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/twitter/twurl/blob/master/LICENSE)
[![Gem Version](https://badge.fury.io/rb/twurl.svg)](https://badge.fury.io/rb/twurl)

Twurl is like curl, but tailored specifically for the Twitter API.
It knows how to grant an access token to a client application for
a specified user and then sign all requests with that access token.
@@ -10,34 +13,31 @@ as defining aliases for common requests, as well as support for
multiple access tokens to easily switch between different client
applications and Twitter accounts.


Installing Twurl
----------------

Twurl can be installed using ruby gems:
Twurl can be installed using RubyGems:

```
```sh
gem install twurl
```


Getting Started
---------------

If you haven't already, the first thing to do is apply for a developer account to access Twitter APIs:
If you haven't already, the first thing to do is apply for a developer account to access Twitter APIs:

```
```text
https://developer.twitter.com/en/apply-for-access
```

After you have that access you can create a Twitter app and generate a consumer key and secret.


After you have that access you can create a Twitter app and generate a consumer key and secret.

When you have your consumer key and its secret you authorize
your Twitter account to make API requests with your consumer key
your Twitter account to make API requests with that consumer key
and secret.

```
```sh
twurl authorize --consumer-key key \
--consumer-secret secret
```
@@ -47,14 +47,13 @@ Authenticate to Twitter, and then enter the returned PIN back into
the terminal. Assuming all that works well, you will be authorized
to make requests with the API. Twurl will tell you as much.


Making Requests
---------------

The simplest request just requires that you specify the path you
want to request.

```
```sh
twurl /1.1/statuses/home_timeline.json
```

@@ -63,47 +62,61 @@ Similar to curl, a GET request is performed by default.
You can implicitly perform a POST request by passing the -d option,
which specifies POST parameters.

```
```sh
twurl -d 'status=Testing twurl' /1.1/statuses/update.json
```

You can explicitly specify what request method to perform with
the -X (or --request-method) option.

```
```sh
twurl -X POST /1.1/statuses/destroy/1234567890.json
```

Accessing Different Hosts
-------------------------

You can access different hosts for other Twitter APIs using the -H flag.

```sh
twurl -H "ads-api.twitter.com" "/5/accounts"
```

Uploading Media
---------------

To upload binary files, you can format the call as a form post. Below, the binary is "/path/to/media.jpg" and the form field is "media":

```sh
twurl -H "upload.twitter.com" -X POST "/1.1/media/upload.json" --file "/path/to/media.jpg" --file-field "media"
```

Creating aliases
----------------

```
```sh
twurl alias h /1.1/statuses/home_timeline.json
```

You can then use "h" in place of the full path.

```
```sh
twurl h
```

Paths that require additional options such as request parameters for example can
be used with aliases the same as with full explicit paths, just as you might
expect.
Paths that require additional options (such as request parameters, for example) can be used with aliases the same as with full explicit paths, just as you might expect.

```
```sh
twurl alias tweet /1.1/statuses/update.json
twurl tweet -d "status=Aliases in twurl are convenient"
```


Changing your default profile
-----------------------------

The first time you authorize a client application to make requests on behalf of your account, twurl stores your access token information in its .twurlrc file. Subsequent requests will use this profile as the default profile. You can use the 'accounts' subcommand to see what client applications have been authorized for what user names:

```
```sh
twurl accounts
noradio
HQsAGcBm5MQT4n6j7qVJw
@@ -114,7 +127,7 @@ twurl accounts

Notice that one of those consumer keys is marked as the default. To change the default use the 'set' subcommand, passing then either just the username, if it's unambiguous, or the username and consumer key pair if it isn't unambiguous:

```
```sh
twurl set default testiverse
twurl accounts
noradio
@@ -124,7 +137,7 @@ twurl accounts
guT9RsJbNQgVe6AwoY9BA (default)
```

```
```sh
twurl set default noradio HQsAGcBm5MQT4n6j7qVJw
twurl accounts
noradio
@@ -137,7 +150,7 @@ twurl accounts
Contributors
------------

Marcel Molina <[email protected]> / @noradio
Marcel Molina / @noradio
Erik Michaels-Ober / @sferik

and there are many [more](https://github.com/twitter/twurl/graphs/contributors)!
5 changes: 2 additions & 3 deletions twurl.gemspec
Original file line number Diff line number Diff line change
@@ -5,11 +5,10 @@ require 'twurl/version'

Gem::Specification.new do |spec|
spec.add_dependency 'oauth', '~> 0.4'
spec.authors = ["Marcel Molina", "Erik Michaels-Ober"]
spec.authors = ["Marcel Molina", "Erik Michaels-Ober", "@TwitterDev team"]
spec.description = %q{Curl for the Twitter API}
spec.email = ['[email protected]']
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
spec.extra_rdoc_files = %w(CODE_OF_CONDUCT.md INSTALL.md LICENSE README.md)
spec.extra_rdoc_files = %w(CODE_OF_CONDUCT.md CONTRIBUTING.md INSTALL LICENSE README.md)
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?('test/') }
spec.homepage = 'http://github.com/twitter/twurl'
spec.licenses = ['MIT']