mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GPU Computing (https://www.mersenneforum.org/forumdisplay.php?f=92)
-   -   Is there any API that could submit TF result using an automatic program? (https://www.mersenneforum.org/showthread.php?t=27345)

Neutron3529 2021-11-24 17:36

Is there any API that could submit TF result using an automatic program?
 
Currently, mfaktc does not support communicate with primenet, and I want to write a program to provide a way.



I tried several times, and this is the best result I got:



[FONT=monospace][COLOR=#000000]You were logged in but your login session expired before the results were submitted.<br>Please log back in and re-submit the results.[/COLOR]
[/FONT]


Is there any API or suggestions?


Here is my code(written in Rust)
```
//[dependencies]
//reqwest = { version="*", features=["multipart"]}
//tokio = { version="*", features=["full"]}
// *** represents something secret and should be modified carefully.
const SECRET_ID:&str=***An ID is needed here***;
use reqwest::multipart;

use reqwest::header;

async fn send(s:&'static str)->Result<reqwest::Response,reqwest::Error>{
let form = multipart::Form::new()
// Adding just a simple text field...
.text("data", s)
.text("was_logged_in_as",SECRET_ID);

let mut headers = header::HeaderMap::new();

headers.insert("cookies",header::HeaderValue::from_static("GIMPSWWW=***MAYBE something here is useful, but I do not get the correct answer.***"));

// And finally, send the form
let client = reqwest::Client::builder().default_headers(headers).build()?;
let resp = client
.post("https://www.mersenne.org/manual_result/")
.multipart(form)
.send().await?;
Ok(resp)
}
#[tokio::main]
async fn main(){
if let Ok(resp)=send("UID: Neutron3529/DR722, no factor for M145965041 from 2^73 to 2^74 [mfaktc 0.21 barrett76_mul32_gs]").await{
println!("{:?}",resp);
println!("{}",resp.text().await.unwrap());
}
}

```

chalsall 2021-11-24 17:45

[QUOTE=Neutron3529;593775]Currently, mfaktc does not support communicate with primenet, and I want to write a program to provide a way.[/QUOTE]

Lots of "prior art" in this space. Please see [URL="https://www.gpu72.com/spider/"]this page for a quick-and-dirty bit of Perl[/URL].

I recommend using the other tools linked to from this page. They're much more feature-complete.

Uncwilly 2021-11-24 17:47

You don't need to reinvent the wheel. MISFIT already exists and [URL="https://www.mersenneforum.org/forumdisplay.php?f=103"]there is a subforum for it[/URL].

kriesel 2021-11-24 19:16

See also [URL="https://www.mersenneforum.org/showpost.php?p=488292&postcount=3"]this post[/URL] in the [URL="https://mersenneforum.org/showthread.php?t=24607"]reference info compilation[/URL].

sdbardwick 2021-11-24 21:15

[QUOTE=Uncwilly;593777]You don't need to reinvent the wheel. MISFIT already exists and [URL="https://www.mersenneforum.org/forumdisplay.php?f=103"]there is a subforum for it[/URL].[/QUOTE]
Is there a working download URL somewhere?

Uncwilly 2021-11-24 21:27

[url]https://mersenneforum.org/misfit/downloads/[/url]

Neutron3529 2021-11-25 14:09

[QUOTE=chalsall;593776]Lots of "prior art" in this space. Please see [URL="https://www.gpu72.com/spider/"]this page for a quick-and-dirty bit of Perl[/URL].

I recommend using the other tools linked to from this page. They're much more feature-complete.[/QUOTE]


thank you for telling me this good page.


although the perl script does not work for me (or I had changed something wrong)
the python script works.


Thanks:)


All times are UTC. The time now is 15:07.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.