this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add images only option

+25 -18
+25 -18
emojidex
··· 139 139 #[argh(option, description = "limit the amount of results returned.")] 140 140 limit: Option<usize>, 141 141 142 + #[argh(switch, description = "only displays images.")] 143 + images_only: bool, 144 + 142 145 #[argh(switch, description = "filter out r18 emoji.")] 143 146 sfw: bool, 144 147 ··· 161 164 resolution, 162 165 limit, 163 166 auth, 167 + images_only, 164 168 } = argh::from_env(); 165 169 166 170 let tmp_dir = env::temp_dir(); ··· 218 222 let encoded_code = emoji.code.replace(" ", "_"); 219 223 let svg_url = format!("{}/{}.svg", BASE_CDN_URL, encoded_code.clone()); 220 224 221 - println!("\x1B[1mURL:\x1B[0m\n\t{}\n", svg_url.clone()); 225 + if !images_only { 226 + println!("\x1B[1mURL:\x1B[0m\n\t{}\n", svg_url.clone()); 222 227 223 - println!( 224 - "\x1B[1mHTML:\x1B[0m\n\t<img class=\"emojidex-emoji\" src=\"{}\" emoji-code=\"{}\" alt=\"{}\"{} />\n", 225 - svg_url.clone(), 226 - encoded_code.clone(), 227 - emoji.code.clone(), 228 - emoji 229 - .moji 230 - .as_ref() 231 - .map(|moji| format!(" emoji-moji=\"{}\"", moji)) 232 - .unwrap_or_else(|| "".to_string()), 233 - ); 228 + println!( 229 + "\x1B[1mHTML:\x1B[0m\n\t<img class=\"emojidex-emoji\" src=\"{}\" emoji-code=\"{}\" alt=\"{}\"{} />\n", 230 + svg_url.clone(), 231 + encoded_code.clone(), 232 + emoji.code.clone(), 233 + emoji 234 + .moji 235 + .as_ref() 236 + .map(|moji| format!(" emoji-moji=\"{}\"", moji)) 237 + .unwrap_or_else(|| "".to_string()), 238 + ); 239 + 240 + println!( 241 + "\x1B[1mMD:\x1B[0m\n\t![{}]({} \"{}\")\n", 242 + emoji.moji.unwrap_or(encoded_code.clone()), 243 + svg_url.clone(), 244 + emoji.code.clone(), 245 + ); 246 + } 234 247 235 - println!( 236 - "\x1B[1mMD:\x1B[0m\n\t![{}]({} \"{}\")\n", 237 - emoji.moji.unwrap_or(encoded_code.clone()), 238 - svg_url.clone(), 239 - emoji.code.clone(), 240 - ); 241 248 if resolution != Resolution::None { 242 249 let filepath = tmp_dir.join(format!("{}.png", encoded_code)); 243 250 let mut file = File::create(filepath.clone()).expect("should be able to create file");