find ich schon, wüsste nicht wie
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# # Script zum Kopieren des Liedtitels (in Banshee gespielt) # in die Zwischenablage. # title="~ `banshee-1 --query-title | sed -e 's,^title: ,,'`" artist="`banshee-1 --query-artist | sed -e 's,^artist: ,,'`" bitrate="~ `banshee-1 --query-bit-rate | sed -e 's,^bit-rate: ,,'` kb/s" duration="~ `banshee-1 --query-duration | sed -e 's,^duration: ,,'` Sekunden" album="~ `banshee-1 --query-album | sed -e 's,^album: ,,'`" echo "$artist $title $album $duration $bitrate" | xclip -selection clipboard |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import java.io.*;
import java.net.URL;
import java.util.*;
public class O {
public O() {
List <String> PicList = new ArrayList<String>();
String whattosearch = "<img src";
String temp_line = "";
String[] split;
try
{
URL url = new URL("http://ubuntuusers.de/");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
while(br.ready()) {
temp_line = br.readLine();
if(temp_line.contains(whattosearch)) {
String temp = temp_line.substring(temp_line.lastIndexOf("img src"));
split = temp.split(""");
temp = split[1];
PicList.add(temp);
}
}
for (String bild : PicList) {
if (!bild.contains("http")) {
bild = url+bild;
}
System.out.println(bild);
}
}catch(Throwable throwable) { }
}
/**
* @param args
*/
public static void main(String[] args) {
new O();
}
}
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import java.io.*;
import java.net.URL;
import java.util.*;
public class O {
public O() {
List <String> PicList = new ArrayList<String>();
String whattosearch = "<img src";
String temp_line = "";
String[] split;
String pfad = "/home/mrks/Desktop/dlbilder/";
try
{
URL url = new URL("http://www.golem.de");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
while(br.ready()) {
temp_line = br.readLine();
if(temp_line.contains(whattosearch)) {
String temp = temp_line.substring(temp_line.lastIndexOf("img src"));
split = temp.split(""");
temp = split[1];
PicList.add(temp);
}
}
for (String bild : PicList) {
if (!bild.contains("http")) {
bild = url+bild;
}
Runtime.getRuntime().exec("wget "+bild+" -P "+pfad);
}
}catch(Throwable throwable) { }
}
/**
* @param args
*/
public static void main(String[] args) {
new O();
}
}
|