Difference between revisions of "Truxton file create url"
Jump to navigation
Jump to search
(→Sample) |
|||
| Line 1: | Line 1: | ||
This creates a website visit object sourced from this file that you can use in the [[Truxton C API#Website Visit | Website Visit API.]] | This creates a website visit object sourced from this file that you can use in the [[Truxton C API#Website Visit | Website Visit API.]] | ||
| − | A URL object is how you add records to the <code>[[WebsiteVisit Table | WebsiteVisit]]</code> table. | + | A URL object is how you add records to the <code><nowiki>[</nowiki>[[WebsiteVisit Table|WebsiteVisit]]<nowiki>]</nowiki></code> table. |
The resulting object will automatically be associated with the file it was created from and with the media the file belongs to. | The resulting object will automatically be associated with the file it was created from and with the media the file belongs to. | ||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
uint64_t truxton_file_create_url( uint64_t file_handle ); | uint64_t truxton_file_create_url( uint64_t file_handle ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 16: | Line 16: | ||
=Sample= | =Sample= | ||
| − | + | <source lang="C" highlight="5"> | |
| − | < | ||
void process_file(uint64_t truxton) | void process_file(uint64_t truxton) | ||
{ | { | ||
| Line 33: | Line 32: | ||
truxton_file_free(file); | truxton_file_free(file); | ||
} | } | ||
| − | </ | + | </source> |
Revision as of 09:18, 10 November 2020
This creates a website visit object sourced from this file that you can use in the Website Visit API.
A URL object is how you add records to the [WebsiteVisit] table.
The resulting object will automatically be associated with the file it was created from and with the media the file belongs to.
Syntax
uint64_t truxton_file_create_url( uint64_t file_handle );
Parameters
file_handle
The handle created by the truxton_file_open_id or truxton_file_open_md5 call.
Return value
A handle to an website visit object.
Sample
void process_file(uint64_t truxton)
{
uint64_t file = truxton_file_open_md5(truxton, "9ec8fb6095c35eff2b236863b7caaf10");
uint64_t url = truxton_child_file_create_url(file);
truxton_url_set_url(url, "https://truxtonforensics.com/");
truxton_url_set_method(url, URL_METHOD_TYPE_USER_FOLLOWED_A_BOOKMARK);
truxton_url_set_type(url, URL_TYPE_OPERA);
truxton_url_set_when(url, truxton_file_get_modified( parent_file ) );
truxton_url_save(url);
truxton_url_destroy(url);
truxton_file_free(file);
}