CN106533926B - Webpage information spreading method and device - Google Patents

Webpage information spreading method and device Download PDF

Info

Publication number
CN106533926B
CN106533926B CN201611223009.4A CN201611223009A CN106533926B CN 106533926 B CN106533926 B CN 106533926B CN 201611223009 A CN201611223009 A CN 201611223009A CN 106533926 B CN106533926 B CN 106533926B
Authority
CN
China
Prior art keywords
picture
content
sharing
view
webpage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611223009.4A
Other languages
Chinese (zh)
Other versions
CN106533926A (en
Inventor
刘一琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611223009.4A priority Critical patent/CN106533926B/en
Publication of CN106533926A publication Critical patent/CN106533926A/en
Application granted granted Critical
Publication of CN106533926B publication Critical patent/CN106533926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/10Multimedia information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a webpage information spreading method and device. The method comprises the following steps: acquiring content of a preset area on a webpage as sharing information according to a triggering instruction of a user; forming the sharing information into sharing pictures; and sharing the sharing picture. According to the method, firstly, according to a trigger instruction of a user, content in a preset area is obtained from a webpage to serve as sharing information, then the sharing information is combined into a sharing picture, and finally the sharing picture is shared.

Description

Webpage information spreading method and device
Technical Field
The invention relates to the technical field of information processing, in particular to a webpage information spreading method and device.
Background
With the continuous development of mobile networks and smart phones, smart phones as an important carrier for information dissemination occupy more and more important positions in people's daily life. In order to realize the propagation of information in different applications or among the same applications, most application software is provided with a sharing function, and the sharing function can share information which a user wants to propagate outwards, such as pictures, characters, two-dimensional codes, web addresses of webpages and the like, to other applications or the same application, so that the information can be conveniently acquired by other people.
The current information sharing mode is generally direct information sharing. For example, if the information that the user wants to share is in a picture format, the information is also in the same picture after sharing through the application; if the shared information is in a text form, the shared information is also in a text form. In particular, when the information that the user wants to share is on a web page, the final information shared is the URL address of the web page. Therefore, other users who want to view the shared information need to use the current application or other applications first and open the original webpage through the URL address of the webpage, so that the users cannot visually see the shared content from the display presentation of the shared information.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method and an apparatus for propagating web page information. The content in the webpage that the user wants to share can be converted into the picture for the user who sees the shared information can see the shared content from the display presentation of the shared information intuitively, and the customer experience degree is improved.
In a first aspect, an embodiment of the present invention provides a method for propagating web page information, where the method is applied to an android operating system, and includes:
acquiring content of a preset area on a webpage as sharing information according to a triggering instruction of a user;
forming the sharing information into sharing pictures;
and sharing the sharing picture.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where: the acquiring content in a predetermined area on a webpage as sharing information specifically includes:
acquiring the content of a currently activated selected area of a webpage; taking the activation distinguishing area as the predetermined area;
acquiring a range object corresponding to the content of the activation selected area;
creating a content node object and filling the content node object with the range object;
converting the content node object filled with the scope object into a character string;
and taking the character string as sharing information.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where: the step of forming the sharing information into sharing pictures specifically includes:
generating a content view according to the character string according to a preset typesetting style;
converting the content view into a view picture;
and taking the view picture as the sharing picture.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where: the sharing information comprises: text and/or pictures;
before the converting the content view into the view picture, the method further comprises:
acquiring a real path of an original picture in the webpage;
judging whether the content view comprises a picture or not;
if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where:
the converting the content view into a view picture specifically includes:
acquiring the width and height of the content view;
creating an empty picture file as an object of the target picture according to the width and the height of the read content view;
and drawing the content of the content view onto the target picture to form a view picture.
In a second aspect, an embodiment of the present invention further provides a device for propagating web page information, where the device is used in an android operating system, and includes:
the sharing information acquiring unit is used for acquiring the content of a preset area on the webpage as sharing information according to a triggering instruction of a user;
the sharing picture conversion unit is used for forming the sharing information into a sharing picture;
and the sharing unit is used for sharing the sharing pictures.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where: the shared information acquiring unit specifically includes:
the activation selected area content acquisition module is used for acquiring the content of the currently activated selected area of the webpage; taking the activation distinguishing area as the predetermined area;
the range object acquisition module is used for acquiring a range object corresponding to the content of the activated selected area;
a content node object creation module for creating a content node object and filling the content node object with the range object;
a character string converting module for converting the content node object filled with the range object into a character string; and taking the character string as sharing information.
With reference to the second aspect, embodiments of the present invention provide a second possible implementation manner of the second aspect, where: the shared picture conversion unit specifically includes:
the content view generation module is used for generating a content view according to the character string in a preset typesetting style;
and the view picture conversion module is used for converting the content view into a view picture and taking the view picture as the sharing picture.
In combination with the second aspect, embodiments of the present invention provide a third possible implementation manner of the second aspect, where: the sharing information comprises: text and/or pictures;
the shared picture conversion unit further includes:
the real path acquisition module is used for acquiring a real path of an original picture in the webpage;
the real path replacing module is used for judging whether the content view comprises a picture or not; if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
In combination with the second aspect, an embodiment of the present invention provides a fourth possible implementation manner of the second aspect, where:
the view picture conversion module specifically includes:
the data acquisition sub-module is used for acquiring the width and the height of the content view;
a picture file creating subunit, configured to create an empty picture file with the width and height of the read content view as an object of the target picture;
and the content view acquisition submodule is used for drawing the content of the content view onto the target picture to form a view picture.
According to the webpage information spreading method and device provided by the embodiment of the invention, firstly, the content of the preset area is obtained from the webpage as the sharing information according to the triggering instruction of the user, then the sharing information forms the sharing picture, and finally the sharing picture is shared out.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a method for propagating web page information according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a specific method for acquiring content in a predetermined area on a web page as shared information in the method for propagating web page information according to the embodiment of the present invention;
fig. 3 is a flowchart illustrating a specific method for sharing information to form a shared picture in the webpage information spreading method according to the embodiment of the present invention;
FIG. 4 is a flow chart illustrating another method for propagating web page information according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram illustrating a web page information dissemination device according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a specific structure of a shared information obtaining unit in the web page information dissemination device according to the embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a specific structure of a shared picture conversion unit in the web page information dissemination device according to the embodiment of the present invention;
fig. 8 is a schematic diagram illustrating a specific structure of another shared picture conversion unit in the web page information dissemination device according to the embodiment of the present invention;
fig. 9 is a schematic structural diagram illustrating a view picture conversion module in the web page information dissemination device according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Currently, when sharing information, application software on the intelligent mobile device directly shares the information, for example, if the information shared by a user is in a picture in an original format, the information shared by the user is in a picture; the original format is a character, and the shared format is the character; the original format is a web page, and what it shares is the URL address of the web page. The sharing results in that when other users want to open the webpage information that a user wants to share, the original webpage needs to be opened through the URL address. This results in the user not being able to view the shared content solely from the displayed presentation of the shared information. Meanwhile, the user may only want to share part of the content on the webpage, but not all the content to other users, but the current information sharing mode cannot be achieved. Meanwhile, the user can only share the information the user wants to share.
In order to facilitate understanding of the embodiment, a detailed description is first given of a webpage information propagation method disclosed in the embodiment of the present invention, and the method can be applied to an intelligent mobile terminal, in particular to an intelligent mobile terminal using an android system, for example, application software installed in a mobile phone, a tablet computer, and the like. The method and the device are used for converting the shared webpage information which the user wants into the picture, and further sharing the user information.
Referring to fig. 1, a method for propagating web page information provided by the embodiment of the present invention includes:
s101: and acquiring the content of a preset area on the webpage as sharing information according to a triggering instruction of a user.
In a specific implementation, a user needs to select information that the user wants to share from a webpage. Generally, a web page provides a user with a selected function by which the user can select a predetermined area on the web page. The predetermined area may include: the number of the predetermined area may be only one or a plurality of the characters and/or pictures. After a user selects the content on the webpage and further forms a preset area, the sharing function of the terminal is triggered, so that the terminal generates a corresponding trigger instruction. And the terminal is triggered according to the trigger instruction, and automatically acquires the content of the preset area on the webpage as sharing information.
Taking an android system as an example: the control used by the android system to load the webpage on the interface is Webview. The content of the predetermined area to be obtained is the content in the Webview, but actually, the Webview does not provide an interface for obtaining the selected content, and even does not provide an interface for obtaining the internal content thereof, so that directly obtaining the content of the predetermined area cannot be realized. However, in Webview, an interface is provided for Java (programming language of android system) to interact with its content JS (JavaScript, a high-level programming language that is a dynamic type through interpretive execution, object-oriented transliteration language), so that the content of a predetermined area in a web page can be acquired through JS.
In the process that Java acquires the content in the Webview through JS, Java is required to send a data calling instruction to JS, and JS is informed to call the content in a preset area from the Webview. After the JS successfully calls the content of the predetermined area from the Webview, Java is notified so that the Java receives the content of the predetermined area called by the JS.
In order to implement the above process, firstly, a callback function for which JS is written on the Java side and data is successfully obtained is written, for example, the callback function may be named as getWebData, and a parameter of the callback function is a character string format of the page data obtained by the JS segment. Secondly, the callback function needs to be registered in the JS through the Webview interface, so that the JS can use the callback function. For example, an addJavascript interface method of webview can be called, and the parameter is a Java-end interface method which is called by adding JS. Finally, the interface that the JS is called by the Jaca end needs to be realized: since the sharing logic is actually invoked by a Java (android system) end, the Java end needs to first notify JS to Webview to acquire the content of the predetermined area. Webview provides a loadUrl method to call the JS code, and the parameter of the loadUrl method is the character string of the JS code. In addition, since the interface function used by Java is different in different android versions, considering the adaptation problem, the interface is changed to evaluateJavascript above android 4.4, so that it is necessary to judge that the version of android is greater than 4.4 by executing build.
In addition, it should be noted that the above method for obtaining the content of the predetermined area on the web page implemented in the android system is only an example, and in other systems, or when the android system changes the relevant functions used by the android system, if the Webview provides other interface functions, the JS code is also called by using other interface even functions, and specific setting may be specifically performed according to actual situations, and is not limited herein.
Specifically, referring to fig. 2, an embodiment of the present invention provides a specific method for acquiring content in a predetermined area on a web page as shared information, including:
s201: acquiring the content of a currently activated selected area of a webpage; and taking the activation selection area as the predetermined area.
S202: and acquiring a range object corresponding to the content of the activation selection area.
S203: a content node object is created and populated with the range object.
S204: converting the content node object filled with the scope object into a character string; and using the character string as sharing information.
In the specific implementation, when the content in the webpage is selected, the selected content is directly acquired.
Still taking the android system as an example, to obtain the content of a predefined area of a web page, a Selection object of the web page is first obtained, which represents the currently active Selection area, i.e. the highlighted text block, and/or other elements of the document where the user may perform certain operations. A typical use of the Selection object is as an input by the user, so that the system recognizes which part of the document the user is processing, or as a result of an operation output to the user, where the Selection object is obtained for subsequent obtaining of content selected by the user on the web page, and the Selection object can be obtained by using the window.getselection () function of JS code in web development, but considering that the implementation of different versions of android Webview may be different, in order to maintain compatibility, the window.document.getselection may be called as well, which method can obtain content selected by the current activation of the web page, and which function is used.
In the above process, only the content of the currently activated selected area of the web page is obtained, and actually, the system cannot generate a picture by using the currently activated selected content, so that a range object corresponding to the activated selected content needs to be obtained. The scope object is actually HTML code corresponding to the contents of the currently activated selected region.
Taking the android system as an example, obtaining the Selection object and calling the method getrange at (0) can be used to obtain the scope object, and the scope object is named range here. After the scope object of the content is obtained, an html node object needs to be created to store the content, for example, a div tag may be used, div represents a document content tag, a window.
After the content range object is obtained, copying one part of the internal content of the content range object to be filled in the content for the use of a subsequent java layer, calling an appndchild method of the content to add the content to the content, and calling a cloneContents method of the range object to copy the content by the range object. Meanwhile, because the content is only a tag object, the content needs to be converted into a character string to be convenient for the java layer to use, and the innerHTML member can be directly called to return the character string content.
The content of the preset area on the webpage can be obtained through the method. It should be noted that, in different terminal systems, because there are many differences in system architecture, constructed functions, web page display, etc., there are other methods for obtaining the content of the predetermined area on the web page, and the specific setting can be made according to the actual situation.
S102: and forming the sharing information into a sharing picture.
In a specific implementation, since the content of the predetermined area is already acquired as the sharing information, the sharing information can be subsequently combined into a sharing picture.
Specifically, referring to fig. 3, an embodiment of the present invention further provides a specific method for forming a shared picture from shared information, where the method includes:
s301: generating a content view according to the character string according to a preset typesetting style;
in a specific implementation, since the content node object filled with the range object is already converted into a character string in S204, Java can call the character string. The content contained in the character string is an HTML code of the shared information, so that the style customization operation can be performed on the shared information, namely, a new Webview is used to convert the HTML code corresponding to the shared information into a corresponding view to display the selected shared information or the shared information which a user wants to share, the shared information is displayed on a WEB page, and simultaneously a typesetting style which needs to be set can be used to typeset or edit the content displayed on the WEB page, for example, in an android system, the style of the webpage is generally expressed by a css file, so that a set of css can be defined by self to be put in assets to change the style of the new Webview, thereby changing the style of subsequent production pictures, and the files such as the custom styles can be stored in an assets resource directory to be read, and finally a content view is generated, and the content view is really a new webpage, the web page contains the shared content that the user wants to share.
It should be noted that the layout style of the shared information in the content view may be different from the layout style in the original webpage.
S302: and converting the content view into a view picture, and taking the view picture as the sharing picture.
The method specifically includes, when converting a content view into a view picture:
the width and height of the newly created content view are obtained.
And creating an empty picture file as an object of the target picture according to the width and the height of the read content view.
And drawing the content of the content view onto the target picture to form a view picture.
Still take the android system as an example: and directly calling getWidth () method, and obtaining the width and height of the Webview by the getHeight () method. Creating an empty bitmap (bitmap file) object as an object of the target picture by calling a bitmap provided by an android system. However, because the view of the android can only draw on the Canvas object, and cannot directly draw a view on the bitmap object, a Canvas object needs to be created through the bitmap, the bitmap is the most parameter of the construction method, then the draw method of the Webview is called, the parameter is transferred to the Canvas object, and the Webview content is drawn on the bitmap.
S103: and sharing the sharing picture.
According to the webpage information spreading method provided by the embodiment of the invention, firstly, the content of the preset area is obtained from the webpage as the sharing information according to the triggering instruction of the user, then the sharing information forms the sharing picture, and finally the sharing picture is shared out.
Referring to fig. 4, an embodiment of the present invention further provides another method for propagating web page information, where on the basis of the foregoing several embodiments, before converting the content view into a view picture, the method further includes:
s401: acquiring a real path of an original picture in the webpage;
s402: judging whether the content view comprises a picture or not;
s403: if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
In the specific implementation, since the picture included in the original webpage may be selected by the user as a part of the shared content, and the picture path displayed by the part of the picture in the HTML may be a relative path, after the view content is generated, the path of the part of the picture is accessed locally through the first-pair path, and thus the path of the part of the picture needs to be restored to the real path address.
Taking an android system as an example, when a real path of an original picture in a webpage needs to be acquired, firstly, an onLoadResource method of an original Webview is monitored, wherein the onLoadResource method is a callback of Webview loading resources, and absolute paths (namely real paths) are generated for resources of relative paths, so that a list of character strings is defined, and all paths of jpg,. png and. gif are stored.
The method includes the steps that a relative path of a picture in a new Webview is replaced by an absolute path, a shoulderceptrequest method monitored by a Webview state can be rewritten, all requests with hyperlinks in the Webview can be intercepted by the callback method, logic for url judgment is added in a shoulderceptrequest callback, whether the url of a current picture stores sub-content in a character String list is judged, whether the absolute path contains the relative path is judged only if the relative path is definitely a subset of the absolute path, for example, the relative path is "/abc.jpg", and the absolute path is http:// www.abc.com/abc.jj ", and a java String class contentions method can be called to judge, and when the pgs are judged to be the subset of the absolute path, the absolute path is covered by the absolute path.
Still another embodiment of the present invention further provides a web page information dissemination device, as shown in fig. 5, the web page information dissemination device provided in the embodiment of the present invention includes:
the sharing information acquiring unit is used for acquiring the content of a preset area on the webpage as sharing information according to a triggering instruction of a user;
the sharing picture conversion unit is used for forming the sharing information into a sharing picture;
and the sharing unit is used for sharing the sharing pictures.
In this embodiment, specific functions and interaction modes of the shared information obtaining unit, the shared picture converting unit, and the sharing unit may refer to the record of the embodiment corresponding to fig. 1, and are not described herein again.
According to the webpage information spreading device provided by the embodiment of the invention, the shared information acquisition unit is used firstly, the content of the preset area is acquired from the webpage as shared information according to the triggering instruction of the user, then the shared information is converted into the shared picture by the shared picture conversion unit, and finally the shared picture is shared by the shared unit.
Still another embodiment of the present invention further provides a specific structure of the shared information obtaining unit, and as shown in fig. 6, the shared information obtaining unit specifically includes:
the activation selected area content acquisition module is used for acquiring the content of the currently activated selected area of the webpage; taking the activation distinguishing area as the predetermined area;
the range object acquisition module is used for acquiring a range object corresponding to the content of the activated selected area;
a content node object creation module for creating a content node object and filling the content node object with the range object;
a character string converting module for converting the content node object filled with the range object into a character string; and taking the character string as sharing information.
In this embodiment, specific functions and interaction modes of the content obtaining module, the range object obtaining module, the content node object creating module, and the character string converting module in the region selection are activated, which can be referred to the description of the embodiment corresponding to fig. 2, and are not described herein again.
Still another embodiment of the present invention further provides a specific structure of a shared picture conversion unit, and referring to fig. 7, the shared picture conversion unit specifically includes:
the content view generation module is used for generating a content view according to the character string in a preset typesetting style;
and the view picture conversion module is used for converting the content view into a view picture and taking the view picture as the sharing picture.
In this embodiment, the specific functions and interaction modes of the content view generation module and the view image conversion module can refer to the records of the embodiment corresponding to fig. 3, and are not described herein again.
Still another embodiment of the present invention provides another specific structure of a shared picture conversion unit, and referring to fig. 8, the shared picture conversion unit further includes:
the real path acquisition module is used for acquiring a real path of an original picture in the webpage;
the real path replacing module is used for judging whether the content view comprises a picture or not; if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
In this embodiment, the specific functions and interaction manners of the real path obtaining module and the real path replacing module may refer to the record of the embodiment corresponding to fig. 4, and are not described herein again.
Still another embodiment of the present invention further provides a specific structure of a view picture conversion module, as shown in fig. 9, the view picture conversion module specifically includes:
the data acquisition sub-module is used for acquiring the width and the height of the content view;
a picture file creating subunit, configured to create an empty picture file with the width and height of the read content view as an object of the target picture;
and the content view acquisition submodule is used for drawing the content of the content view onto the target picture to form a view picture.
In this embodiment, the specific functions and interaction manners of the data obtaining sub-module, the picture file creating sub-unit, and the content view obtaining sub-module may refer to the records of the embodiment corresponding to fig. 3, and are not described herein again.
The method for the device for propagating web page information and the computer program product of the device provided by the embodiments of the present invention include a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (4)

1. A webpage information transmission method is applied to an android operating system and is characterized by comprising the following steps:
acquiring content of a preset area on a webpage as sharing information according to a triggering instruction of a user;
forming the sharing information into sharing pictures;
sharing the sharing picture;
the acquiring content of the predetermined area on the webpage as the sharing information includes:
writing a callback function of which JS acquisition data succeeds in obtaining at a Java end, wherein the parameter of the callback function is the character string format of the page data acquired by the JS section;
registering the callback function to JS through a Webview interface so that the JS uses the callback function;
informing JS at a Java end to acquire the content of the preset area from Webview;
the acquiring content of a predetermined area on a webpage as sharing information further includes:
acquiring a Selection object of a webpage;
calling getransgetAt (0) to acquire a scope object of the Selection object;
creating an html node object, and filling the html node object by using the range object;
converting the html node object filled with the scope object into a character string;
taking the character string as sharing information;
wherein, the forming of the sharing information into a sharing picture includes:
generating a content view according to the character string according to a preset typesetting style;
acquiring the width and height of the content view;
creating an empty bitmap file as an object of the target picture according to the width and the height of the read content view;
creating a Canvas object by using a bitmap, taking the bitmap as a parameter of a Canvas object construction method, calling a draw method of Webview, and transmitting the Canvas object by the parameter to draw the content of a content view onto a target picture to form a view picture;
taking the view picture as the sharing picture;
wherein before the obtaining the width and height of the content view, further comprising:
acquiring a real path of an original picture in the webpage;
judging whether the content view comprises a picture or not;
if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
2. The method of claim 1, wherein the sharing information comprises: text and/or pictures.
3. A webpage information dissemination device is applied to an android operating system and is characterized by comprising:
the sharing information acquiring unit is used for acquiring the content of a preset area on the webpage as sharing information according to a triggering instruction of a user;
the sharing picture conversion unit is used for forming the sharing information into a sharing picture;
the sharing unit is used for sharing the sharing pictures;
the shared information acquisition unit is specifically configured to:
writing a callback function of which JS acquisition data succeeds in obtaining at a Java end, wherein the parameter of the callback function is the character string format of the page data acquired by the JS section;
registering the callback function to JS through a Webview interface so that the JS uses the callback function;
informing JS at a Java end to acquire the content of the preset area from Webview;
wherein, the sharing information obtaining unit specifically includes:
activating a region Selection content acquisition module for acquiring a Selection object of a webpage;
a range object acquisition module for calling getrange at (0) to acquire a range object of the Selection object;
the content node object creating module is used for creating an html node object and filling the html node object by using the range object;
the character string conversion module is used for converting the html node object filled with the range object into a character string; taking the character string as sharing information;
the shared picture conversion unit specifically includes:
the content view generation module is used for generating a content view according to the character string in a preset typesetting style;
the view picture conversion module is used for converting the content view into a view picture and taking the view picture as the sharing picture;
the view picture conversion module specifically includes:
the data acquisition sub-module is used for acquiring the width and the height of the content view;
a picture file creating subunit, configured to create an empty bitmap file as an object of the target picture according to the width and height of the read content view;
the content view acquisition submodule is used for creating a Canvas object by utilizing a bitmap, taking the bitmap as a parameter of a Canvas object construction method, calling a draw method of Webview, and transmitting the Canvas object by the parameter to draw the content of the content view onto a target picture to form a view picture;
wherein, the sharing picture conversion unit further comprises:
the real path acquisition module is used for acquiring a real path of an original picture in the webpage;
the real path replacing module is used for judging whether the content view comprises a picture or not; if so, replacing the relative path of the picture in the content view with the real path corresponding to the picture obtained in advance.
4. The apparatus of claim 3, wherein the sharing information comprises: text and/or pictures.
CN201611223009.4A 2016-12-27 2016-12-27 Webpage information spreading method and device Active CN106533926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611223009.4A CN106533926B (en) 2016-12-27 2016-12-27 Webpage information spreading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611223009.4A CN106533926B (en) 2016-12-27 2016-12-27 Webpage information spreading method and device

Publications (2)

Publication Number Publication Date
CN106533926A CN106533926A (en) 2017-03-22
CN106533926B true CN106533926B (en) 2020-06-12

Family

ID=58338413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611223009.4A Active CN106533926B (en) 2016-12-27 2016-12-27 Webpage information spreading method and device

Country Status (1)

Country Link
CN (1) CN106533926B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108322384A (en) * 2018-01-09 2018-07-24 论客科技(广州)有限公司 Mail sharing method, apparatus and system based on instant messaging
CN108268662B (en) * 2018-02-09 2020-11-10 平安科技(深圳)有限公司 Social graph generation method based on H5 page, electronic device and storage medium
CN108920518B (en) * 2018-06-04 2022-04-01 上海东方报业有限公司 Data generation method and equipment
CN109145239B (en) * 2018-07-31 2021-05-28 深圳点猫科技有限公司 Multi-platform screenshot sharing method based on subject game and electronic equipment
CN109525652B (en) * 2018-10-31 2021-07-23 北京小米移动软件有限公司 Information sharing method, device, equipment and storage medium
CN110457623A (en) * 2019-06-26 2019-11-15 网宿科技股份有限公司 Acquisition methods, server and the storage medium of webpage frame
CN112162687B (en) * 2020-10-22 2022-07-29 腾讯科技(深圳)有限公司 Picture generation method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102982144A (en) * 2012-11-22 2013-03-20 东莞宇龙通信科技有限公司 Method and system for sharing webpage information
CN103731467A (en) * 2013-09-26 2014-04-16 西安酷派软件科技有限公司 Webpage information sharing method and communication terminal
CN104333531A (en) * 2013-07-22 2015-02-04 腾讯科技(深圳)有限公司 Network resource sharing and obtaining method, device, terminal
CN104991930A (en) * 2015-07-01 2015-10-21 安一恒通(北京)科技有限公司 Webpage information sharing method and apparatus
CN105760540A (en) * 2016-03-15 2016-07-13 广州阿里巴巴文学信息技术有限公司 Method and equipment for processing webpage and electronic equipment
CN106815316A (en) * 2016-12-23 2017-06-09 北京奇虎科技有限公司 Method, device and mobile terminal that content of pages is shared

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104035753B (en) * 2013-03-04 2018-11-02 优视科技有限公司 A kind of method and system of double WebView displayings customized web pages
CN104035929B (en) * 2013-03-04 2018-07-06 腾讯科技(深圳)有限公司 Webpage capture method and apparatus
CN104077323A (en) * 2013-03-29 2014-10-01 中国移动通信集团公司 Method and device for converting web page content to multimedia messages
CN104461283A (en) * 2014-11-18 2015-03-25 小米科技有限责任公司 Network view screen shooting method and device and electronic device
CN105653178A (en) * 2015-05-28 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Information sharing method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102982144A (en) * 2012-11-22 2013-03-20 东莞宇龙通信科技有限公司 Method and system for sharing webpage information
CN104333531A (en) * 2013-07-22 2015-02-04 腾讯科技(深圳)有限公司 Network resource sharing and obtaining method, device, terminal
CN103731467A (en) * 2013-09-26 2014-04-16 西安酷派软件科技有限公司 Webpage information sharing method and communication terminal
CN104991930A (en) * 2015-07-01 2015-10-21 安一恒通(北京)科技有限公司 Webpage information sharing method and apparatus
CN105760540A (en) * 2016-03-15 2016-07-13 广州阿里巴巴文学信息技术有限公司 Method and equipment for processing webpage and electronic equipment
CN106815316A (en) * 2016-12-23 2017-06-09 北京奇虎科技有限公司 Method, device and mobile terminal that content of pages is shared

Also Published As

Publication number Publication date
CN106533926A (en) 2017-03-22

Similar Documents

Publication Publication Date Title
CN106533926B (en) Webpage information spreading method and device
JP6740373B2 (en) Page component dynamic layout
US10877640B2 (en) Application interface management method and apparatus
TWI703463B (en) Information display method, device and intelligent terminal
CN108038134B (en) Page display method and device, storage medium and electronic equipment
US10084878B2 (en) Systems and methods for hosted application marketplaces
CN105335132B (en) Method, device and system for customizing application program function
CN112114913B (en) Application program interface updating method and device, computer equipment and storage medium
CN111428170B (en) Web page rendering method and device
CN115098098A (en) Page generation method, page display method and device
CN112016023A (en) Service processing method, device, terminal and storage medium
CN113792208B (en) Picture interaction method, device, equipment, medium and program product based on webpage
CN108319474B (en) Page information generation method, device and equipment
CN111897607A (en) Application interface loading and interaction method, device and storage medium
CN117390326A (en) Page management method, device, equipment and storage medium
CN111381745B (en) Page switching method, device and equipment
CN115809056B (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
CN112114804A (en) Application program generation method, device and system
CN113296906B (en) Task configuration method and device
CN108304169B (en) Implementation method, device and equipment for HTML5 application
CN114528510A (en) Webpage data processing method and device, electronic equipment and medium
CN114862470A (en) Advertisement resource adaptation method and device, computer equipment and storage medium
CN114168875A (en) Page program generation method and device, computer equipment and storage medium
CN112783548B (en) Access method and device of network system
CN114489607A (en) Cross-stack application processing and page rendering method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant