NEWS
Bilder von Webseiten als Telegram verwenden
-
Hi Leute,
ich hab mir heute ein mini Script gebaut um mir Graphen usw als Bild an Telegram schicken zu lassen.
Bis jetzt funktioniert das soweit prima.
Was ist zutun?
- apt install cutycapt
- apt-get install xvfb
- DP erzeugen (String)
- Blockly importieren
- DP mit gewünschter URL füllen
Ich hoffe ich konnte damit jemandem helfen.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id=";U2+aG2^)S9cKIWY7oZB">Resulution</variable> <variable id=")(VU4!b;sLaq?uIanzNw">Time</variable> <variable id=",Bx8GC_L@0BA(j4.G^eR">Command</variable> </variables> <block type="on_ext" id="p+Z*v?s+Y7MY)z6}|T~s" x="163" y="138"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="_(Eya`A#}c+I0~Bo*M-S"> <field name="oid">0_userdata.0.GlobalVars.GenerateImage</field> </shadow> </value> <statement name="STATEMENT"> <block type="variables_set" id="#B8o@Gb[ONMo$Z-OX_%g"> <field name="VAR" id=";U2+aG2^)S9cKIWY7oZB">Resulution</field> <value name="VALUE"> <block type="text" id="Hac+KFpx=]xPM:`#hfCG"> <field name="TEXT">1280x1200</field> </block> </value> <next> <block type="variables_set" id="m+]jD8C[^,(n0v5Z0AYS"> <field name="VAR" id=")(VU4!b;sLaq?uIanzNw">Time</field> <value name="VALUE"> <block type="text" id="+MS(k1,4[d=CTKkQttzj"> <field name="TEXT">5000</field> </block> </value> <next> <block type="variables_set" id="pwXWG8lxe47,x}hgGtM;"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> <value name="VALUE"> <block type="text_join" id="k[LxKn!JINxVZA+C6SXq"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="uuA5+p0d}12aPEFg(5O*"> <field name="TEXT">xvfb-run --server-args="-screen 0, </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="z3v[.fw#0Bb1Y!flbpL^"> <field name="VAR" id=";U2+aG2^)S9cKIWY7oZB">Resulution</field> </block> </value> <value name="ADD2"> <block type="text" id=";SN;Yg=rf!Ts;Z[3/.!T"> <field name="TEXT">x24" cutycapt --java=on --javascript=on --plugins=on --auto-load-images=on --delay=</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="BID)gP@nn=o#4y6seGq~"> <field name="VAR" id=")(VU4!b;sLaq?uIanzNw">Time</field> </block> </value> <value name="ADD4"> <block type="text" id="0HI^-.R+gK?YTB6kV();"> <field name="TEXT"> --out=/tmp/site.png --url=</field> </block> </value> <value name="ADD5"> <block type="on_source" id="mK:WNux^Hj*o9(jytP:F"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <next> <block type="exec" id="nhv@oJ+]g$B}%0aXs#R]"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation> <field name="WITH_STATEMENT">TRUE</field> <field name="LOG">log</field> <value name="COMMAND"> <shadow type="text" id="^@j!u5S`Z#n$d6tEq_+y"> <field name="TEXT">text</field> </shadow> <block type="variables_get" id="O|0/pBeS%ygO|3ck}UkD"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> </block> </value> <statement name="STATEMENT"> <block type="debug" id="0-FM-EnJ3=S^Dqm-$Lw_"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Zh^I[T~[=[U#a#c-=Q_]"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="lLO*h~wC`xA{jUQ~wso_"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="Nj==M~kI_oxeA#2sv4C8"> <field name="TEXT">Create image with: </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="r)TB}e;Cx9e,!NiG,Jxx"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> </block> </value> </block> </value> <next> <block type="telegram" id=")gpo89*RNS57#X$wUtr]"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <value name="MESSAGE"> <shadow type="text" id=")Snebe|T#PQjtpCJI(TV"> <field name="TEXT">/tmp/site.png</field> </shadow> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>Nachtrag:
Um eine lokale Datei einzulesen geht es wie folgt:file:///tmp/MyFile.html -
Hi Leute,
ich hab mir heute ein mini Script gebaut um mir Graphen usw als Bild an Telegram schicken zu lassen.
Bis jetzt funktioniert das soweit prima.
Was ist zutun?
- apt install cutycapt
- apt-get install xvfb
- DP erzeugen (String)
- Blockly importieren
- DP mit gewünschter URL füllen
Ich hoffe ich konnte damit jemandem helfen.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id=";U2+aG2^)S9cKIWY7oZB">Resulution</variable> <variable id=")(VU4!b;sLaq?uIanzNw">Time</variable> <variable id=",Bx8GC_L@0BA(j4.G^eR">Command</variable> </variables> <block type="on_ext" id="p+Z*v?s+Y7MY)z6}|T~s" x="163" y="138"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="_(Eya`A#}c+I0~Bo*M-S"> <field name="oid">0_userdata.0.GlobalVars.GenerateImage</field> </shadow> </value> <statement name="STATEMENT"> <block type="variables_set" id="#B8o@Gb[ONMo$Z-OX_%g"> <field name="VAR" id=";U2+aG2^)S9cKIWY7oZB">Resulution</field> <value name="VALUE"> <block type="text" id="Hac+KFpx=]xPM:`#hfCG"> <field name="TEXT">1280x1200</field> </block> </value> <next> <block type="variables_set" id="m+]jD8C[^,(n0v5Z0AYS"> <field name="VAR" id=")(VU4!b;sLaq?uIanzNw">Time</field> <value name="VALUE"> <block type="text" id="+MS(k1,4[d=CTKkQttzj"> <field name="TEXT">5000</field> </block> </value> <next> <block type="variables_set" id="pwXWG8lxe47,x}hgGtM;"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> <value name="VALUE"> <block type="text_join" id="k[LxKn!JINxVZA+C6SXq"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="uuA5+p0d}12aPEFg(5O*"> <field name="TEXT">xvfb-run --server-args="-screen 0, </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="z3v[.fw#0Bb1Y!flbpL^"> <field name="VAR" id=";U2+aG2^)S9cKIWY7oZB">Resulution</field> </block> </value> <value name="ADD2"> <block type="text" id=";SN;Yg=rf!Ts;Z[3/.!T"> <field name="TEXT">x24" cutycapt --java=on --javascript=on --plugins=on --auto-load-images=on --delay=</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="BID)gP@nn=o#4y6seGq~"> <field name="VAR" id=")(VU4!b;sLaq?uIanzNw">Time</field> </block> </value> <value name="ADD4"> <block type="text" id="0HI^-.R+gK?YTB6kV();"> <field name="TEXT"> --out=/tmp/site.png --url=</field> </block> </value> <value name="ADD5"> <block type="on_source" id="mK:WNux^Hj*o9(jytP:F"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <next> <block type="exec" id="nhv@oJ+]g$B}%0aXs#R]"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation> <field name="WITH_STATEMENT">TRUE</field> <field name="LOG">log</field> <value name="COMMAND"> <shadow type="text" id="^@j!u5S`Z#n$d6tEq_+y"> <field name="TEXT">text</field> </shadow> <block type="variables_get" id="O|0/pBeS%ygO|3ck}UkD"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> </block> </value> <statement name="STATEMENT"> <block type="debug" id="0-FM-EnJ3=S^Dqm-$Lw_"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Zh^I[T~[=[U#a#c-=Q_]"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="lLO*h~wC`xA{jUQ~wso_"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="Nj==M~kI_oxeA#2sv4C8"> <field name="TEXT">Create image with: </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="r)TB}e;Cx9e,!NiG,Jxx"> <field name="VAR" id=",Bx8GC_L@0BA(j4.G^eR">Command</field> </block> </value> </block> </value> <next> <block type="telegram" id=")gpo89*RNS57#X$wUtr]"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <value name="MESSAGE"> <shadow type="text" id=")Snebe|T#PQjtpCJI(TV"> <field name="TEXT">/tmp/site.png</field> </shadow> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>Nachtrag:
Um eine lokale Datei einzulesen geht es wie folgt:file:///tmp/MyFile.html@christoph1337 super - danke dir
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden