Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Community Lounge > Suggestions & Feedback
FedoraForum Search

Forgot Password? Join Us!

Suggestions & Feedback Have suggestions, feedback or just plain questions regarding FedoraForum.org? Post them here. (We reserve the right to poke fun at you or just ignore them).

Reply
 
Thread Tools Search this Thread Display Modes
  #31  
Old 14th June 2011, 01:42 PM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Upminster, Essex, UK
Posts: 169
linuxfedorafirefox
Re: Fedora Useragent

What is the full distro list of icons that are actually available? - it might be vaguely entertaining to masquerade as something really whack once in a while
Reply With Quote
  #32  
Old 14th June 2011, 02:22 PM
leigh123linux
Guest
 
Posts: n/a
linuxredhatfirefox
Re: Fedora Useragent

Quote:
Originally Posted by satanselbow View Post
What is the full distro list of icons that are actually available? - it might be vaguely entertaining to masquerade as something really whack once in a while

Pick your way through that.

Code:
<?xml version="1.0" encoding="ISO-8859-1"?> 
 
<product productid="displayos" active="1">
    <title>Display OS and Browser</title>
    <description>Displays the OS and Browser information for each post</description>
    <version>1.00</version>
    <url>http://www.vbulletin.org/forum/misc.php?do=product</url>
    <versioncheckurl><![CDATA[http://www.vbulletin.org/forum/misc.php?do=productcheck&pid=displayos]]></versioncheckurl>
    <dependencies>
    </dependencies>
    <codes>
        <code version="1.0.0">
            <installcode><![CDATA[$vbulletin->db->query_write("CREATE TABLE `" . TABLE_PREFIX . "postinfo` ( 
`postid` INT( 6 ) NOT NULL , 
`os` VARCHAR( 20 ) NOT NULL , 
`browser` VARCHAR( 20 ) NOT NULL 
) ENGINE = MYISAM ;"); 
 
$vbulletin->db->query_write("ALTER TABLE `postinfo` ADD PRIMARY KEY ( `postid` ) "); 
$vbulletin->db->query_write("ALTER TABLE `postinfo` ADD INDEX ( `postid` ) ");]]></installcode>
            <uninstallcode><![CDATA[$vbulletin->db->query_write("DROP TABLE `postinfo` ");]]></uninstallcode>
        </code>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>save on new post</title>
            <hookname>newpost_complete</hookname>
            <phpcode><![CDATA[$useragent = $_SERVER ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT']; 
    $ua = strtolower($useragent); 
    $ua_browser = 'unknown'; 
    $ua_os = 'unknown'; 
 
    // Browser detection: 
    if (strpos($ua, 'epiphany') !== false) $ua_browser = 'epiphany'; 
    else if (strpos($ua, 'chrome') !== false) $ua_browser = 'chrome'; 
    else if (strpos($ua, 'midori') !== false) $ua_browser = 'midori'; 
    else if (strpos($ua, 'arora') !== false) $ua_browser = 'arora'; 
    else if (strpos($ua, 'galeon') !== false) $ua_browser = 'galeon'; 
    else if (strpos($ua, 'kazehakase') !== false) $ua_browser = 'kazehakase'; 
    else if (strpos($ua, 'safari') !== false) $ua_browser = 'safari'; 
    else if (strpos($ua, 'konqueror') !== false) $ua_browser = 'konqueror'; 
    else if (strpos($ua, 'iceweasel') !== false) $ua_browser = 'iceweasel'; 
    else if (strpos($ua, 'swiftfox') !== false) $ua_browser = 'swiftfox'; 
    else if (strpos($ua, 'firefox') !== false) $ua_browser = 'firefox'; 
    else if (strpos($ua, 'seamonkey') !== false) $ua_browser = 'seamonkey'; 
    else if (strpos($ua, 'minefield') !== false) $ua_browser = 'minefield'; 
    else if (strpos($ua, 'k-meleon') !== false) $ua_browser = 'k-meleon'; 
    else if (strpos($ua, 'firebird') !== false) $ua_browser = 'firebird'; 
    else if (strpos($ua, 'netscape') !== false) $ua_browser = 'netscape'; 
    else if (strpos($ua, 'mozilla') !== false && strpos($ua, 'rv:') !== false) $ua_browser = 'mozilla'; 
    else if (strpos($ua, 'opera') !== false)  
    { 
        if (strpos($ua, 'opera mini ') !== false) $ua_browser = 'operamini'; 
        else $ua_browser = 'opera'; 
    } 
    else if (strpos($ua, 'avant browser') !== false) $ua_browser = 'avant'; 
    else if (strpos($ua, 'maxthon') !== false || strpos($ua, 'myie') !== false) $ua_browser = 'maxthon'; 
    else if (strpos($ua, 'slimbrowser') !== false) $ua_browser = 'slimbrowser'; 
    else if (strpos($ua, 'msie') !== false) $ua_browser = 'ie'; 
 
 
    // OS detection: 
    if (strpos($ua, 'amiga') !== false) $ua_os = 'amiga'; 
    else if (strpos($ua, 'beos; ') !== false) $ua_os = 'beos'; 
    else if (strpos($ua, 'freebsd') !== false) $ua_os = 'freebsd'; 
    else if (strpos($ua, 'cros') !== false) $ua_os = 'linuxcros'; 
    else if (strpos($ua, 'linux') !== false) 
    { 
        if (strpos($ua, 'debian') !== false) $ua_os = 'linuxdebian'; 
        else if (strpos($ua, 'fedora') !== false) $ua_os = 'linuxfedora'; 
        else if (strpos($ua, 'gentoo') !== false) $ua_os = 'linuxgentoo'; 
        else if (strpos($ua, 'kateos') !== false || strpos($ua, 'kate os') !== false) $ua_os = 'linuxkateos'; 
        else if (strpos($ua, 'knoppix') !== false) $ua_os = 'linuxknoppix'; 
        else if (strpos($ua, 'kubuntu') !== false) $ua_os = 'linuxkubuntu'; 
                else if (strpos($ua, 'pclinuxos') !== false) $ua_os = 'linuxpclinuxos'; 
        else if (strpos($ua, 'mandriva') !== false || strpos($ua, 'mandrake') !== false) $ua_os = 'linuxmandriva'; 
        else if (strpos($ua, 'redhat') !== false || strpos($ua, 'red hat') !== false) $ua_os = 'linuxredhat'; 
        else if (strpos($ua, 'slackware') !== false) $ua_os = 'linuxslackware'; 
        else if (strpos($ua, 'suse') !== false) $ua_os = 'linuxsuse'; 
        else if (strpos($ua, 'ubuntu') !== false) $ua_os = 'linuxubuntu'; 
                else if (strpos($ua, 'mint') !== false) $ua_os = 'linuxmint'; 
        else if (strpos($ua, 'arch') !== false) $ua_os = 'linuxarch'; 
        else $ua_os = 'linux'; 
    } 
    else if (strpos($ua, 'macosx') !== false || strpos($ua, 'macos') !== false || strpos($ua, 'mac os x') !== false || strpos($ua, 'macintosh') !== false || strpos($ua, 'os=mac') !== false || strpos($ua, 'mac_osx') !== false) $ua_os = 'macos'; 
    else if (strpos($ua, 'macppc') !== false || strpos($ua, 'mac_ppc') !== false || strpos($ua, 'cpu=ppc;') !== false && strpos($ua, 'os=mac') !== false || strpos($ua, 'macintosh; ppc') !== false || strpos($ua, 'macintosh;') !== false && strpos($ua, 'ppc') !== false || strpos($ua, 'mac_powerpc') !== false) $ua_os = 'macos'; 
    else if (strpos($ua, 'netbsd') !== false) $ua_os = 'netbsd'; 
    else if (strpos($ua, 'sunos') !== false || strpos($ua, 'solaris') !== false) $ua_os = 'solaris'; 
    else if (strpos($ua, 'symbian') !== false) $ua_os = 'symbian'; 
    else if (strpos($ua, 'unix') !== false) $ua_os = 'unix'; 
    else if (strpos($ua, 'windows nt 5.0') !== false || strpos($ua, 'windows 2000') !== false || strpos($ua, 'win2000') !== false ||  strpos($ua, 'winnt5.0') !== false) $ua_os = 'windows_98_nt_2000'; 
    else if (strpos($ua, 'windows 95') !== false || strpos($ua, 'win95') !== false) $ua_os = 'windows_98_nt_2000'; 
    else if (strpos($ua, 'windows me') !== false || strpos($ua, 'winme') !== false || strpos($ua, 'win9x 4.90') !== false || strpos($ua, 'win 9x 4.90') !== false) $ua_os = 'windows_me'; 
    else if (strpos($ua, 'windows 98') !== false || strpos($ua, 'win98') !== false) $ua_os = 'windows_98_nt_2000'; 
    else if (strpos($ua, 'windows nt 5.2') !== false || strpos($ua, 'winnt5.2') !== false) $ua_os = 'windows_98_nt_2000'; 
    else if (strpos($ua, 'windows nt 5.1') !== false || strpos($ua, 'windows xp 5.1') !== false || strpos($ua, 'windows xp') !== false || strpos($ua, 'winxp') !== false || strpos($ua, 'winnt5.1') !== false || strpos($ua, 'cygwin_nt-5.1') !== false) $ua_os = 'windows_xp_2003'; 
    else if (strpos($ua, 'windows nt 6.0') !== false || strpos($ua, 'winnt6.0') !== false) $ua_os = 'windows_vista'; 
        else if (strpos($ua, 'windows nt 6.1') !== false || strpos($ua, 'winnt6.1') !== false) $ua_os = 'windows_7'; 
    else if (strpos($ua, 'windows nt 4.0') !== false || strpos($ua, 'winnt4.0') !== false || strpos($ua, 'winnt') !== false || strpos($ua, 'windows nt') !== false) $ua_os = 'windows_98_nt_2000'; 
    else if (strpos($ua, 'windows') !== false || strpos($ua, 'win') !== false) $ua_os = 'windows_xp_2003'; 
    else if (strpos($ua, 'macintosh') !== false || strpos($ua, 'mac') !== false) $ua_os = 'macos'; 
 
 
$browser = $ua_browser; 
$os = $ua_os; 
 
$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "postinfo (postid, OS, browser) VALUES (" . $post['postid'] . ",'$os' ,'$browser')");]]></phpcode>
        </plugin>
        <plugin active="1" executionorder="5">
            <title>Display the information on postbit</title>
            <hookname>postbit_display_complete</hookname>
            <phpcode><![CDATA[/*$template_hook['postbit_userinfo_right'] .= $post['OS'] . " / " . $post['browser'];*/ 
 
$os = $post['OS']; 
$browser = $post['browser']; 
$template_hook['postbit_userinfo_right'] .= "<img src='images/useragent/icon_$os.gif' alt='$os' /><img src='images/useragent/icon_$browser.gif' alt='$browser' />";]]></phpcode>
        </plugin>
        <plugin active="1" executionorder="5">
            <title>Loads the information back on showthread</title>
            <hookname>showthread_query</hookname>
            <phpcode><![CDATA[$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "postinfo AS postinfo ON (post.postid=postinfo.postid)"; 
$hook_query_fields .= ", postinfo.browser AS browser, postinfo.OS as OS";]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
    </phrases>
    <options>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>
Reply With Quote
  #33  
Old 14th June 2011, 02:33 PM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Upminster, Essex, UK
Posts: 169
windows_98_nt_2000firefox
Re: Fedora Useragent

Oh yeah I'm cooking on retro os / browser heaven

*** oooops forgot to take FF out completely... oh well... ***

Last edited by satanselbow; 14th June 2011 at 02:36 PM.
Reply With Quote
  #34  
Old 15th June 2011, 03:20 AM
TheNosh Offline
Registered User
 
Join Date: May 2011
Posts: 45
linuxkazehakase
Re: Fedora Useragent

posting to test something.
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #35  
Old 15th June 2011, 03:23 AM
Wayne Online
Registered User
 
Join Date: Aug 2009
Location: In a cardboard box
Posts: 1,966
unknownfirefox
Re: Fedora Useragent

My user agent is unknown too. Very strange... Let's see what it says:

Mozilla/5.0 (OS/2; Warp 4.5; rv:2.0.2pre) Gecko/20110603 Firefox/4.0.2pre SeaMonkey/2.1.1pre
__________________
I used to miss my wife but then my aim improved.
Reply With Quote
  #36  
Old 15th June 2011, 03:29 AM
TheNosh Offline
Registered User
 
Join Date: May 2011
Posts: 45
windows_98_nt_2000netscape
Re: Fedora Useragent

Testing one more thing.

Haha! Excellent!
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #37  
Old 15th June 2011, 06:24 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 558
linuxsafari
Re: Fedora Useragent

TheNosh you win :-)

leigh123linux I see Android has been left out...
Reply With Quote
  #38  
Old 15th June 2011, 07:06 AM
TheNosh Offline
Registered User
 
Join Date: May 2011
Posts: 45
windows_98_nt_2000netscape
Re: Fedora Useragent

Quote:
Originally Posted by Jamwa View Post
TheNosh you win :-)

leigh123linux I see Android has been left out...
Thank you. I like your direction as well. I was considering going with something contradictory, but then I decided to just be humorously outdated.
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #39  
Old 16th June 2011, 01:02 AM
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 5,634
unixfirebird
Re: Fedora Useragent

Quote:
Originally Posted by leigh123linux View Post
Pick your way through that.
Cool. Too bad that all the commercial UNIX systems other than Solaris (e.g. AIX, HP-UX, IRIX, Tru64) all get lumped together as just "UNIX". And no love for running Mosaic on NeXTSTEP.
Reply With Quote
  #40  
Old 26th June 2011, 07:17 PM
SwampKracker Offline
Registered User
 
Join Date: Jun 2009
Location: Champaign, IL
Posts: 222
linuxfirefox
Re: Fedora Useragent

Just testing my useragent tweak....

one more time....

---------- Post added at 01:17 PM ---------- Previous post was at 01:12 PM ----------

Keeping fingers crossed...
__________________
Fedora 16 | Intel i5-2500K @ 4.0GHz | 8GB DDR3 | Nvidia GTX 560Ti-448OC
Mint 14 Xfce | AMD Phenom II N660 | 8GB | AMD HD4270

Last edited by SwampKracker; 26th June 2011 at 07:16 PM.
Reply With Quote
  #41  
Old 27th June 2011, 05:24 PM
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 5,634
linuxfedorafirefox
Re: Fedora Useragent

Quote:
Originally Posted by SwampKracker View Post
Just testing my useragent tweak....

one more time....

---------- Post added at 01:17 PM ---------- Previous post was at 01:12 PM ----------

Keeping fingers crossed...
Keep trying, you'll get it eventually!
__________________
"I'm not glad he's dead, but I'm glad he's gone."
-- Richard M. Stallman, on the death of Steve Jobs
Reply With Quote
  #42  
Old 10th August 2011, 10:18 AM
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 34
Posts: 3,312
linuxfedorafirefox
Re: Fedora Useragent

test () {
ADD: general.useragent.override IN about.config
SET: Mozilla/5.0 (X11; Fedora Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0.1
}
Remove capitals and ":"

Yay, ty Leigh.
This is so much better than the addon, as that one is reset everytime FF is closed

In order to make it a little easier, i tried to write a script, but i did something wrong with the syntax, hope someone able to tell the fault:

PHP Code:
#!/bin/bash
input() {
    echo -
"# | ${greenf}$1${reset}"
    
read -"# | Type your input: " response ; echo
    echo 
"$response"
}
myDistro="$(input 'Enter your Distro's name, example Fedora, RedHat.. Attention, edit the script if you dont use FireFox4.0.1 or 32bit')"

cd ~/.mozilla/firefox
find 
./ -name "prefs.js" -exec grep {} useragent user_pref("general.useragent.override""Mozilla/5.0 (X11; $myDistro Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1")\; -print 
__________________
Laptop: Toshiba satellite p50-a-11 CPU: Intel i7 8*2400 MHz GPU: GeForce GT 745M RAM: 8192 MB Distro: Fedora (Rawhide) DE: Awesome
Text User Interface (TUI) // Windows 8+ & Fedora 20+ Dualboot

Last edited by sea; 10th August 2011 at 10:49 AM.
Reply With Quote
  #43  
Old 22nd September 2011, 03:30 PM
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 34
Posts: 3,312
linuxfedorafirefox
Re: Fedora Useragent

I've worked a bit on my script to determine and generate a useragent string.

Here's the script: (its designed to be used within my script collection, so you WILL NEED to modify to work without them.
The script is FireFox optimized! Dont know how well it works with other browsers.

PHP Code:
#!/bin/bash
# ---------------------------------------------------------------------------------------
# | Project sea:    Package of small scripts for an easy set up of linux uses    |
# | Description:    Adds a useragent string to show Fedora logo in posts.        |
# | Script by:        Simon A. Erat                         (sea)    |
# | Contact:        http://forums.fedoraforum.org/member.php?u=183882    (sea)    |
# | Date (created):    2011.07.24 (Year/Month/Day)                    |
# | Date (changed):    2011.09.22                             |
# | FileVersion:    0.5                                |
    
seaAuthor=sea
# | Resource:        man tr, http://forums.fedoraforum.org/showthread.php?p=1489784    |
# ---------------------------------------------------------------------------------------
# |
# | sea useragent routine
    
seaheader "Automated useragent modifier (beta)"
# |
# | Arrays
    
browsers="epiphany chrome midori arora galeon kazehakase safari konqueror iceweasel swiftfox firefox seamonkey minefield k-meleon firebird netscape mozilla opera "
    
oss="amiga beos freebsd cros linux debian fedora gentoo kateos knoppix kubuntu pclinuxos mandriva linxfromsource redhat slackware suse ubuntu mint arch linux macosx macppc netbsd sunos symbian unix windows macintosh "
# |
# | useragent user_pref\(\"general.useragent.override\", \"Mozilla/5.0 (X11; $myDistro Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\")\; -print
# |
# | check OS / Distro
    
for distro in $oss ; do
        if [ -
"/etc/$distro-release" 
            
then     thisOS=$distro
                seaecho 
"Detected OS:" "$thisOS"
                
break 1
        fi
    done
# | Fixing string issues
    
tmpA=${thisOS:0:1
    
tmp=$( echo $tmpA tr "[:lower:]" "[:upper:]")
    
thisOS="$tmp"${thisOS:1}
# |
# | check Browser
    
for browser in $browsers ; do
        
tmp=$(find $HOME/ -name "$browser")
        if [[ ! 
$tmp "" ]]
            
then    seaecho "Found browser:" "$browser"
                    
break
        
fi
    done
# |
# | get pref.js and its path
    
tmpfile=$(find $HOME/ -name "prefs.js")
    
seaheader "Please select file that shall be checked / changed:"
    
select targetFile in $tmpfile ; do
        
tarPref=$targetFile && break
    
done
# |
# | Variables
    
FFver=$($browser -version)
    
FFlen=${#FFver}
    
FFver=${FFver:$FFlen -5}
    
stringA="user_pref ('general.useragent.override', "
# | Fixing $browser string issues
    
tmpA=${browser:0:1
    
tmp=$( echo $tmpA tr "[:lower:]" "[:upper:]")
    
browser="$tmp"${browser:1}
    
    
stringB="\"$browser/$FFver (X11; $thisOS $(uname -s) $(uname -m); rv:2.0.1) $browser/$FFver\" )"
    
string2replace="$stringA $stringB ;"
# |
# | Write the changes
    
read -"# | Please ${seacolor}close your $browser${reset} now. Then press enter to continue."
    
if cat "$tarPrefgrep "general.useragent"  > /dev/zero
        then    
echo "# | TODO: change existing value.. " 
            
# Prepare string to sed
            #checker="= / ( ) ; :"
            #echo $string2replace | \
            #for sym in $checker ; do
            #     sed -i s/$sym/\\$sym/g 
            #done 
            
seaecho "There was an error with replacing.." "Appending now" 
            
echo "$string2replace"  >> $tarPref && \
            
seaecho "Successfully added, but should have changed."
            
        
else    seaecho "Adding:" "$string2replace"
            
echo "$string2replace"  >> $tarPref && \
            
seaecho "Successfully added."
    
fi 
__________________
Laptop: Toshiba satellite p50-a-11 CPU: Intel i7 8*2400 MHz GPU: GeForce GT 745M RAM: 8192 MB Distro: Fedora (Rawhide) DE: Awesome
Text User Interface (TUI) // Windows 8+ & Fedora 20+ Dualboot

Last edited by sea; 22nd September 2011 at 03:36 PM.
Reply With Quote
  #44  
Old 22nd September 2011, 11:34 PM
SwampKracker Offline
Registered User
 
Join Date: Jun 2009
Location: Champaign, IL
Posts: 222
linuxfedorafirefox
Re: Fedora Useragent

Just a test...and it works
__________________
Fedora 16 | Intel i5-2500K @ 4.0GHz | 8GB DDR3 | Nvidia GTX 560Ti-448OC
Mint 14 Xfce | AMD Phenom II N660 | 8GB | AMD HD4270

Last edited by SwampKracker; 22nd September 2011 at 11:35 PM. Reason: test of useragent string
Reply With Quote
  #45  
Old 18th November 2011, 02:23 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
linuxunknown
Re: Fedora Useragent

Quote:
Originally Posted by sea View Post
I've worked a bit on my script to determine and generate a useragent string.

Here's the script: (its designed to be used within my script collection, so you WILL NEED to modify to work without them.
In order for your post to be genuinely useful would you kindly tell us what those external scripts in your example -- I mean seaheader, seaecho, and possibly others -- are supposed to do?

---------- Post added at 06:23 AM ---------- Previous post was at 06:21 AM ----------

This message was by the way posted from Fedora 16 in a uzbl web browser installed from Fedora's own repo. The browser shows as 'unknown'.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chromium Useragent COKEDUDE Suggestions & Feedback 11 10th June 2012 05:20 PM


Current GMT-time: 16:41 (Tuesday, 02-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat