|
1 | | -# TeSS API Client |
2 | | -A gem for uploading data to the [TeSS](http://tess.elixir-uk.org) portal. Use if you have training or event content you wish to push to TeSS. |
3 | | - |
4 | | -## Get Started |
5 | | -Add the TeSS API to your Gemfile and use bundle to install |
6 | | - |
7 | | -`$ echo "gem 'tess_api_client', :git => git://github.com/ElixirUK/TeSS_api_client.git" >> Gemfile` |
8 | | - |
9 | | -`$ bundle install` |
10 | | - |
11 | | -Create a new ruby script which uses the gem. Use the ContentProvider model to create a new content provider in TeSS and the Material or Event model to create new resources. |
12 | | -`$ nano my_upload_script.rb` |
13 | | - |
14 | | -```ruby |
15 | | -require 'tess_api_client' |
16 | | - |
17 | | -content_provider = Tess::API::ContentProvider.new( |
18 | | - title: 'My Organization Name', |
19 | | - url: 'https://my.org.org/', |
20 | | - image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Smiley.svg/2000px-Smiley.svg.png', |
21 | | - description: "We're sharing our content with TeSS!") |
22 | | - |
23 | | -material = Tess::API::Material.new( |
24 | | - title: 'How to use TeSS API', |
25 | | - url: 'http://mysite.org/tess_api', |
26 | | - short_description: 'Everything you need to know to get you started using the TeSS API', |
27 | | - doi: 'http://dx.doi.org/10002-20fk', |
28 | | - remote_updated_date: Time.now, |
29 | | - content_provider: content_provider, # The content provider is created if needed when the material is created. |
30 | | - scientific_topic: ['Computational Biology'], |
31 | | - keywords: ['tutorial', 'TeSS', 'sharing']) |
32 | | - |
33 | | -material.create |
34 | | -``` |
35 | | - |
36 | | -## Futher Examples |
37 | | -More examples can be found in the `test` directory of this repository, or in the [TeSS Scrapers repository](https://github.com/ElixirTeSS/TeSS_scrapers) |
| 1 | +# TeSS API Client |
| 2 | +A gem for uploading data to the [TeSS](http://tess.elixir-uk.org) portal. Use if you have training or event content you wish to push to TeSS. |
| 3 | + |
| 4 | +## Get Started |
| 5 | +Add the TeSS API to your Gemfile and use bundle to install |
| 6 | + |
| 7 | +`$ echo "gem 'tess_api_client', :git => git://github.com/ElixirUK/TeSS_api_client.git" >> Gemfile` |
| 8 | + |
| 9 | +`$ bundle install` |
| 10 | + |
| 11 | +Create a new ruby script which uses the gem. Use the ContentProvider model to create a new content provider in TeSS and the Material or Event model to create new resources. |
| 12 | +`$ nano my_upload_script.rb` |
| 13 | + |
| 14 | +```ruby |
| 15 | +require 'tess_api_client' |
| 16 | + |
| 17 | +content_provider = Tess::API::ContentProvider.new( |
| 18 | + title: 'My Organization Name', |
| 19 | + url: 'https://my.org.org/', |
| 20 | + image_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Smiley.svg/2000px-Smiley.svg.png', |
| 21 | + description: "We're sharing our content with TeSS!") |
| 22 | + |
| 23 | +material = Tess::API::Material.new( |
| 24 | + title: 'How to use TeSS API', |
| 25 | + url: 'http://mysite.org/tess_api', |
| 26 | + description: 'Everything you need to know to get you started using the TeSS API', |
| 27 | + doi: 'http://dx.doi.org/10002-20fk', |
| 28 | + remote_updated_date: Time.now, |
| 29 | + content_provider: content_provider, # The content provider is created if needed when the material is created. |
| 30 | + scientific_topic: ['Computational Biology'], |
| 31 | + keywords: ['tutorial', 'TeSS', 'sharing']) |
| 32 | + |
| 33 | +material.create |
| 34 | +``` |
| 35 | + |
| 36 | +## Futher Examples |
| 37 | +More examples can be found in the `test` directory of this repository, or in the [TeSS Scrapers repository](https://github.com/ElixirTeSS/TeSS_scrapers) |
0 commit comments