intrepidpig / orca Goto Github PK
View Code? Open in Web Editor NEWA reddit API library for Rust
License: Mozilla Public License 2.0
A reddit API library for Rust
License: Mozilla Public License 2.0
I believe the integration style tests you have in src/test.rs
should go in tests/test.rs
(or whatever file name you want) because they will then be classified as "integration tests" by cargo test
. If you have them in the source directory for a specific reason, you can just close this issue, but it is good practice to keep these tests in the proper place for integration tests (although it shouldn't really change anything much)
Thanks!
tried to point to this repo instead of the version on crates.io
probably not highest priority, but it would be cool if master could be relied on (could autodeploy dev changes to master if they compile/pass test suite)
-rust noob
so maybe there is just a flag i can add to ignore #![feature
compilation problem
and generally very open to being wrong//ignored here :)
Hi! I was wondering since this repo hasn't been updated in a couple of years, you'd be willing to release the name for use in crates.io. I have a project I've been working on for which I wish to use the name. Let me know! Thanks in advance.
If you do not have the dev libraries for openssl, building orca fails.
I was on Debian and a simple sudo apt install libssl-dev
fixed the problem.
https://github.com/sfackler/rust-openssl/tree/b8fb29db5c246175a096260eacca38180cd77dd0 has information on what to do if you face the same issue on Mac, Windows or Linux.
It might help to add this bit of info to the README.md file.
Reddit does not return the expected ratelimiting headers in the case when using an unauthorized client, in the form of:
fn main() {
let mut app =
App::new("someuseragent", "v0.1.0", "/u/username).expect("Failed to initialize client");
let stream = app.create_comment_stream("all");
for (i, comment) in stream.enumerate() {
println!("{}. {}: {}\n", i, comment.author, comment.body);
}
}
This can also be seen more easily in a browser, when attempting to retrieve something against a json-endpoint while logged out. Since the ratelimiting properties of Connection are then never set, this will cause the small program above to contentiously attempt to fetch posts with no ratelimiting whatsoever. There really doesn't seem to be much useful at all included in the response, so I'm guessing ratelimiting would have to be timer-based or similar.
concerning: Example: Authorizing as OAuth Script type
after a bit of fussing I managed to get the following to work:
use orca::App;
use orca::net::auth::OAuthApp;
fn main () {
let mut reddit = App::new(name, version, author).unwrap();
reddit.authorize(OAuthApp::Script {
id: app_id,
secret: app_secret,
username: username,
password: password
}).unwrap();
println!("{:?}", reddit.get_self());
}
let mut reddit
instead of the current let mut app
? (this one i think is at least straightforward)id:, secret:, username:
) having to be named, might just be me and the weird way I'm accessing it.Not sure how this would be presented. Maybe a Vec of a Scope enum that get's converted to a string representation? Or maybe a struct with lots of boolean fields...
...Only time will telll
The OAuthApp
enum interface has become kind of clumsy I think. I plan on changing it to just three functions, one for each authorization type.
It would be quite useful to have a timestamp in the comment struct which represents a timestamp when the comment was created. Currently there is no information about when the comment was posted.
I'm not exactly sure how this would work.
When I try to submit a self post with & in the text body, everything get's cut off since the & gets treated as a URL parameter delimiter. To fix this, orca needs to convert everything to URL encoded before passing it as a parameter using something like https://rust-lang-nursery.github.io/rust-cookbook/encoding.html#encode-a-string-as-applicationx-www-form-urlencoded.
This issue will track what is implemented and what needs to be implemented.
Holy cow
Right now if a client is left running long enough for their token to expire, the application will panic when it attempts to refresh it. The function that needs the work done is net::auth::OAuth::refresh.
This functionality will need to be tested, which will be somewhat difficult since tokens expire in about 1 hour if I remember correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.