<commit_before>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

mod common;

use tokio::runtime::current_thread::block_on_all;

use egg_mode::search::{self, ResultType};

fn main() {
    let config = common::Config::load();

    //rust tweets around dallas
    let search = block_on_all(
        search::search("rustlang")
            .result_type(ResultType::Recent)
            .count(10)
            .call(&config.token),
    )
    .unwrap();

    for tweet in &search.statuses {
        common::print_tweet(tweet);
        println!()
    }
}
<commit_msg>search example accepts input from stdin<commit_after>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

mod common;

use tokio::runtime::current_thread::block_on_all;

use egg_mode::search::{self, ResultType};

use std::io::{stdin, BufRead};

fn main() {
    let config = common::Config::load();

    println!("Search term:");
    let line = stdin().lock().lines().next().unwrap().unwrap();

    let search = block_on_all(
        search::search(line)
            .result_type(ResultType::Recent)
            .count(10)
            .call(&config.token),
    )
    .unwrap();

    for tweet in &search.statuses {
        common::print_tweet(tweet);
        println!()
    }
}

{'fraction_non_alphanumeric': 0.13905133203378817, 'fraction_numerical': 0.007797270955165692, 'mean_word_length': 2.793103448275862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7275665', 'n_tokens_mistral': 495, 'n_tokens_neox': 478, 'n_words': 139}