Autor Beitrag
MDX
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 30.12.07 00:02 
Also, ich stehe vor einem Problem, ich will gerne ein Programm entwickeln und zwar soll das folgendes können:

Man Gibt eien URL in das Textfeld ein
z.B.: david.zone4fun.info/videodetails.php?id=2

Nun soll das Programm folgenden Code im Dokument suchen:
ausblenden XML-Daten
1:
2:
3:
4:
5:
6:
<param name="allowFullScreen" value="true" /><param name="flashvars" value="&link=http://www.movie-worlds.de/"><param name="allowNetworking" value="internal" />
<embed src="http://david.zone4fun.info/flashplayer.swf?file=movies/19122007000000.flv&autostart=true&logo=http://david.zone4fun.info/logo3.png&image=http://david.zone4fun.info/&link=http://www.movie-worlds.de&backcolor=0x999999&frontcolor=0xcccccc&allowfullscreen=true" type="application/x-shockwave-flash" 
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="450" height="330" play="false" loop="false" quality="high" 
allowscriptaccess="never" flashvars="&link=http://www.movie-worlds.de/" 
allowFullScreen="true" allownetworking="internal">
</embed>

Und daraus den Hervorgehobenen Text auslesen und in einem Textfeld anzeigen, wie kann man das Realisieren

Das Problem: Der Pfad ist nicht immer derselbe, sondern immer ein andere!
mal: movies/2.flv dann wieder movie/3.flv

Hab nähmlich Überhaupt keine Idee :? :?

Danke schonmal im Vorraus
Und einenen Guten RUTSCH ins Jahr 2008
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: So 30.12.07 00:20 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  P1, P2: Integer;
begin
  P1 := Pos('.swf?', Quellcode) + 5;  //Position im Text finden und die 5 Zeichen wieder drauf (damit die Position bei file= ist)
  P2 := Pos('.flv&auto', Quellcode) + 4;  //Hier 4 weil die Ausgabe bis zum & gehen soll
  Ergebnis := Copy(Quellcode, P1, P2 - P1);
end;

So müsste es gehen. Es gibt dir immer genau das was du im Quelltext markiert hast raus.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 30.12.07 00:50 
Danke @Hendi48
Denke, damit könnte es gehen, nur weiß ich jetzt nicht wie ich die Function einbauen soll!

Könntest du es mir schreiben??
THX
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: So 30.12.07 13:12 
Du könntest es einfach als function in dein Programm einfügen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function VideoRausSuchen(Quellcode: string): string
var
  P1, P2: Integer;
begin  
  P1 := Pos('.swf?', Quellcode) + 5;  //Position im Text finden und die 5 Zeichen wieder drauf (damit die Position bei file= ist)  
  P2 := Pos('.flv&auto', Quellcode) + 4;  //Hier 4 weil die Ausgabe bis zum & gehen soll  
  Result := Copy(Quellcode, P1, P2 - P1);  
end;

Ich denke du hast den Quellcode von deinem ersten Post oben in einem string oder so gespeichert und kannst dann einfach diese Funktion z.B. so aufrufen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  Code, Video: string;
begin
  Code := ... {Hier musst du den Quellcode zuweisen}
  Video := VideoRausSuchen(Code);
end;

Das kannst du z.B. in einem Button aufrufen.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 30.12.07 13:43 
user profile iconHendi48 hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function VideoRausSuchen(Quellcode: string): string
var
  P1, P2: Integer;
begin  
  P1 := Pos('.swf?', Quellcode) + 5;  //Position im Text finden und die 5 Zeichen wieder drauf (damit die Position bei file= ist)  
  P2 := Pos('.flv&auto', Quellcode) + 4;  //Hier 4 weil die Ausgabe bis zum & gehen soll  
  Result := Copy(Quellcode, P1, P2 - P1);  
end;


Ich denke mal das der Hervorgehobene Code den verbleibenden Quellcode kopieren soll, stimmt das?
Funltioniert nähmlich irgendwie nicht ganz.... :nixweiss:
Es gibt keine Fehler, doch ausführen tut das Programm auch nicht..

Hilfe... :?!?: :?!?:

Und mir fällt sonst nix ein, wie ich den Code ausgeben könnte... :gruebel:
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 30.12.07 13:57 
Wie wärs, wenn du die gesamte Funktion in deinen Quelltext übernimmst... :wink:

Vom PC benutzt du ja auch nicht nur die Tastatur, weils am wichtigsten aussieht (gaaaaaaanz viele Knöpfe zum drücken :mrgreen:)

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 30.12.07 14:08 
ausblenden volle Höhe Delphi-Quelltext
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:
45:
46:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ExtDlgs;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function VideoRausSuchen(Quellcode: string): string;
var
  P1, P2: Integer;
begin
  P1 := Pos('.swf?', Quellcode) + 5;  //Position im Text finden und die 5 Zeichen wieder drauf (damit die Position bei file= ist)
  P2 := Pos('.flv&auto', Quellcode) + 4;  //Hier 4 weil die Ausgabe bis zum & gehen soll
  Result := Copy(Quellcode, P1, P2 - P1);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Quellcode, Video: string;
begin
  Quellcode := 'http://lol.de/FLASHPLAYER.swf?file=movies/2000.flv'{Hier musst du den Quellcode zuweisen}
  Video := VideoRausSuchen(Quellcode);
end;



end.

So sieht mein Quellcode aus!

Und ich hänge das "PROGRAMM" in den Anhang

P.S.: Ich benutze (fast) nur die Tastatur weil meine Maus schrott ist...
Einloggen, um Attachments anzusehen!
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: So 30.12.07 14:48 
Hm, das kann ja auch nicht gehen weil es dann in der URL sucht. Du musst schon vorher mittels einer Internet Komponente wie IdHTTP (dazu musst du wie ich dir im andern Thread schon gesagt hatte Indy installieren) den Quelltext downloaden und dann auf die Variable zuweisen. Dann geht das auch.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 30.12.07 16:03 
Danke an Hendi48

Problem gelöst!!!