Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Generowanie screenów stron
spayk
post
Post #1





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


Poszukuje szybkiego i łatwego sposobu na wygenerowanie screena "jakiejs" strony.

Ten post edytował spayk 15.02.2012, 14:55:58
Go to the top of the page
+Quote Post
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




To zmień nazwę tematu. Screen strony to nie miniaturka.


--------------------
Go to the top of the page
+Quote Post
Monter08
post
Post #3





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

Ostrzeżenie: (0%)
-----


Poczytaj tutaj, nie jestem pewien czy do końca o coś takiego Ci chodzi.
Go to the top of the page
+Quote Post
spayk
post
Post #4





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


w skrypcie podaje adres, on ma się łączyc i pobrac screen
Go to the top of the page
+Quote Post
Monter08
post
Post #5





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

Ostrzeżenie: (0%)
-----


Z Twoim podejściem lepiej przeczytaj jeszcze raz wypowiedź wokkiebba, tutaj możemy Cię tylko nakierować, podpowiedzieć a resztę sam musisz główkować.
Go to the top of the page
+Quote Post
spayk
post
Post #6





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


jeśli ma ktoś czas, chwilke o przetestowanie tego
http://www.thumbalizr.com/apitools.php

cos mi to nie działa i wywala błąd ;/
  1. Warning: Invalid argument supplied for foreach() in /home/u782433241/public_html/thumbalizr/class.inc.php on line 49
Go to the top of the page
+Quote Post
Monter08
post
Post #7





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

Ostrzeżenie: (0%)
-----


Pokaż kod.
Go to the top of the page
+Quote Post
spayk
post
Post #8





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


  1. <? if ( !defined("_THUMBALIZR") ) die ("no access");
  2.  
  3. class thumbalizrRequest {
  4.  
  5. function __construct() {
  6. global $thumbalizr_config,$thumbalizr_defaults;
  7. $this->api_key=$thumbalizr_config['api_key'];
  8. $this->service_url=$thumbalizr_config['service_url'];
  9. $this->use_local_cache=$thumbalizr_config['use_local_cache'];
  10. $this->local_cache_dir=$thumbalizr_config['local_cache_dir'];
  11. $this->local_cache_expire=$thumbalizr_config['local_cache_expire'];
  12. $this->encoding=$thumbalizr_defaults['encoding'];
  13. $this->quality=$thumbalizr_defaults['quality'];
  14. $this->delay=$thumbalizr_defaults['delay'];
  15. $this->bwidth=$thumbalizr_defaults['bwidth'];
  16. $this->mode=$thumbalizr_defaults['mode'];
  17. $this->bheight=$thumbalizr_defaults['bheight'];
  18. $this->width=$thumbalizr_defaults['width'];
  19. }
  20.  
  21. private function build_request($url) {
  22. $this->request_url=
  23. $this->service_url."?".
  24. "api_key=".$this->api_key."&".
  25. "quality=".$this->quality."&".
  26. "width=".$this->width."&".
  27. "encoding=".$this->encoding."&".
  28. "delay=".$this->delay."&".
  29. "mode=".$this->mode."&".
  30. "bwidth=".$this->bwidth."&".
  31. "bheight=".$this->bheight."&".
  32. "url=".$url;
  33. $this->local_cache_file=md5($url)."_".$this->bwidth."_".$this->bheight."_".$this->delay."_".$this->quality."_".$this->width.".".$this->encoding;
  34. $this->local_cache_subdir=$this->local_cache_dir."/".substr(md5($url),0,2);
  35. }
  36.  
  37.  
  38. function request($url) {
  39. $this->build_request($url);
  40. if (file_exists($this->local_cache_subdir."/".$this->local_cache_file)) {
  41. $filetime=filemtime($this->local_cache_subdir."/".$this->local_cache_file);
  42. $cachetime=time()-$filetime-($this->local_cache_expire*60*60);
  43. } else {
  44. $cachetime=-1;
  45. }
  46. if (!file_exists($this->local_cache_subdir."/".$this->local_cache_file) || $cachetime>=0) {
  47. $this->img= file_get_contents($this->request_url);
  48. $headers="";
  49. foreach($http_response_header as $tmp) {
  50. if (strpos($tmp,'X-Thumbalizr-')!==false) {
  51. $tmp1=explode('X-Thumbalizr-',$tmp); $tmp2=explode(': ',$tmp1[1]); $headers[$tmp2[0]]=$tmp2[1];
  52. }
  53. }
  54. $this->headers= $headers;
  55. $this->save();
  56. } else {
  57. $this->img= file_get_contents($this->local_cache_subdir."/".$this->local_cache_file);
  58. $this->headers['URL']= $url;
  59. $this->headers['Status']= 'LOCAL';
  60. }
  61. }
  62.  
  63. private function save() {
  64. if ($this->img && $this->use_local_cache===TRUE && $this->headers['Status']=="OK") {
  65. if (!file_exists($this->local_cache_subdir)) { mkdir($this->local_cache_subdir); }
  66. $fp=fopen($this->local_cache_subdir."/".$this->local_cache_file,'w');
  67. fwrite($fp,$this->img);
  68. fclose($fp);
  69. }
  70. }
  71.  
  72. function output($sendHeader = true,$destroy = true) {
  73. if ($this->img) {
  74. if ($sendHeader) {
  75. if ($this->encoding=="jpg") {
  76. header("Content-type: image/jpeg");
  77. } else {
  78. header("Content-type: image/png");
  79. }
  80. foreach($this->headers as $k=>$v) {
  81. header("X-Thumbalizr-".$k.": ".$v);
  82. }
  83. }
  84. echo $this->img;
  85. if ($destroy) {
  86. $this->img= false;
  87. }
  88. } else {
  89. return false;
  90. }
  91. }
  92.  
  93. }
  94. ?>
Go to the top of the page
+Quote Post
wNogachSpisz
post
Post #9





Grupa: Zarejestrowani
Postów: 1 233
Pomógł: 87
Dołączył: 6.03.2009

Ostrzeżenie: (40%)
XX---


Zastanawiam się ile było identycznych tematów..

Użyj IECapt.
Go to the top of the page
+Quote Post
spayk
post
Post #10





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


pomoże ktos z problemem wyżej ?
Go to the top of the page
+Quote Post
sebekzosw
post
Post #11





Grupa: Zarejestrowani
Postów: 437
Pomógł: 42
Dołączył: 16.04.2007

Ostrzeżenie: (0%)
-----


miałem problem, ale wykorzystałem programik o którym mówi wNogachSpisz
Go to the top of the page
+Quote Post
spayk
post
Post #12





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


tylko ja to słabo ogarniam ;/
Go to the top of the page
+Quote Post
Monter08
post
Post #13





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

Ostrzeżenie: (0%)
-----


Zacznijmy może od tego gdzie stoi twój serwer www?
Go to the top of the page
+Quote Post
spayk
post
Post #14





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


jest u prywatnej osoby na vps
jakie opcje mają być włączone ?
Go to the top of the page
+Quote Post
wNogachSpisz
post
Post #15





Grupa: Zarejestrowani
Postów: 1 233
Pomógł: 87
Dołączył: 6.03.2009

Ostrzeżenie: (40%)
XX---


Samo PHP to za mało, potrzebny jest dostęp do silnika renderującego.
IEcapt jest o tyle dobre, że zadziałają na nim wtyczki flash/java.
Go to the top of the page
+Quote Post
spayk
post
Post #16





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


a co do www.thumbalizr.com questionmark.gif
Go to the top of the page
+Quote Post
Monter08
post
Post #17





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

Ostrzeżenie: (0%)
-----


Zapewne także wykorzystują jakiś zewnętrznych aplikacji.
Go to the top of the page
+Quote Post
spayk
post
Post #18





Grupa: Zarejestrowani
Postów: 364
Pomógł: 3
Dołączył: 29.11.2008

Ostrzeżenie: (0%)
-----


no ale jak z tego skorzystac ?
Wszystko robie dobrze ale mam jakiś błąd tongue.gif

Czy jest ktos w stanie to sprawdzic ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 14:19